You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenCode cost: a partial step sum must not be recorded as the run's authoritative provider cost #3960
From the review of #3959 (F1), in code that came from main with #3780.
Problem:applyOpenCodeCost / parseOpenCodeJsonl (packages/core/src/agents/impl/openCodeParsing.ts) skip a completed step whose cost is missing or invalid, without marking coverage incomplete. The remaining subtotal is returned as cost. OpenCodeAgent.buildExecutionResponse and evaluateOpenCodeAnalysis expose it as providerCostUsd, and calculateCost in llmMetrics.ts returns it directly, bypassing whole-run token pricing.
So a run with one priced step and one unpriced step is recorded with only the priced part.
If the priced step reports 0, the whole run is recorded as free.
Do:
Track cost coverage per distinct completed step. Return the step sum only when every such step has a valid cost; otherwise leave cost undefined unless a valid cumulative result total exists.
Keep the duplicate-step handling and the explicit-zero semantics.
Update the test "sums known step costs when other steps have missing or invalid costs": it should now expect undefined, so token pricing applies. Add a test where a priced 0 step plus an unpriced step does not record the run as free.
Activity
propr-dev commentedon Dec 1, 2026
🤖 AI processing has started for this issue using codex agent with gpt-6.2-sol model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
codexgpt-6.2-sol3960/gpt-6.2-sol-opencode-cost-a-partial-s-20261201-1126-jrk3758-epic-runtime-abstraction-sc0issue-3960-20261201-1126-gpt-6.2-sol-jrk🔍 Track Task Execution
integry commentedon Dec 1, 2026
Done in #3961, which merged into the runtime epic; the epic merged into
mainwith #3774 and ships in 0.9.4.