Repository navigation
[3960 by GPT-6.2 Sol] OpenCode cost: a partial step sum must not be recorded as the run's authoritative provider cost - #3961
Conversation
OpenCode now reports a provider cost only when it has a valid cumulative total or a valid cost for every distinct completed step. Duplicate events still count once, and an explicit whole-run zero is preserved. Removed duplicate `providerCostUsd` assignments from the failure adapters. A regression test verifies that a zero-cost step plus an unpriced step uses whole-run token pricing. All 104 focused tests and the core TypeScript check passed. ProPR-Agent: codex/gpt-6.2-sol
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationReady to merge within scope, based on static review of the supplied diff and surrounding code. The change is focused and implements the intended cost-completeness rule. ✅ Complete totals only — Unpriced distinct steps suppress the incremental cost sum, while a later valid repeat resolves the missing cost. ✅ Zero remains meaningful — Nullish fallback preserves an explicit cumulative zero, and priced-step deduplication prevents repeated costs from being added. ✅ Fallback coverage — The new regression verifies that a zero-cost step plus an unpriced step retains aggregate tokens and reaches token pricing. Removing duplicate adapter assignments preserves existing behavior. The supplied current-head status reports 17 passed checks and no failures. No commands or tests were run during this review. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Cover duplicate-token fallbackConsider a follow-up test combining repeated step IDs with an unpriced distinct step. ScoreThe implementation satisfies the scoped objective with targeted regression coverage and passing current-head checks. Static tracing found no merge-blocking regression. Score: 9/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
AI Implementation Summary
Closes #3960
Branch:
3960/gpt-6.2-sol-opencode-cost-a-partial-s-20261201-1126-jrkCommits: ✅ Changes committed (a0bc38d)
AI Processing Completed
Execution Details:
Summary:
OpenCode now reports a provider cost only when it has a valid cumulative total or a valid cost for every distinct completed step. Duplicate events still count once, and an explicit whole-run zero is preserved.
Removed duplicate
providerCostUsdassignments from the failure adapters. A regression test verifies that a zero-cost step plus an unpriced step uses whole-run token pricing.All 104 focused tests and the core TypeScript check passed.
Review digest
Risk-tiered paths
packages/core/src/agents/impl/openCodeParsing.ts(+15/−8)packages/core/src/agents/impl/utils/failedAgentExecution.ts(+0/−2)test/llmMetricsProviderCost.test.ts(+12/−0)test/opencodeCostReporting.test.ts(+17/−14)Diff size: 4 files changed, +44/−24 lines
View task for the run's logs and conversation.
This PR was created automatically by ProPR after processing issue #3960.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!