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
console: Go usage breakdown shows duplicate model rows #45502
The OpenCode Go usage breakdown can display two rows for the same model with the same quota, including DeepSeek V4 Flash. Usage recorded before quota-multiplier metadata was added remains separate from newer usage even when both resolve to the same multiplier.
Environment
opencode version: Console source at c2eacd72afc4a4984564c393e15ab30011057269 (dev); the customer's deployed revision was not inspected.
OS / Terminal / Shell / Active plugins: Not relevant to this hosted Console aggregation bug.
Install/channel: Hosted OpenCode Go usage page; deterministic local reproduction using Bun 1.3.14.
Reproduction
Use a Go model in a usage window containing both historical requests without enrichment.costMultiplier and newer requests with that field.
Have the historical fallback resolve to the same multiplier as the newer requests.
Expand the window's usage details on the Go page.
The same failure is reproducible directly through buildLiteUsageBreakdown by passing two sources with identical model IDs and resolved multipliers, one estimated and one recorded.
Expected Behavior
One row per model and resolved quota multiplier, with summed cost and quota contribution. Actual multiplier changes should remain separate because their displayed quotas differ.
Actual Behavior
Two rows have the same model name and quota. The breakdown helper keeps both query groups rather than merging them after the fallback multiplier has been resolved.
Additional Context
queryLiteUsageDetails groups by model and the raw stored multiplier. Historical NULL metadata therefore forms a separate SQL group. Commit afd6f3b064bbb5d49ecd8e2d1037f5deca711d9e introduced recording the multiplier on August 25.
This is a presentation-aggregation issue, not evidence of duplicated requests or charges. Peak/off-peak token prices affect request cost, not this grouping key. Reproduced against the actual breakdown helper; no customer database records were queried.
Taking this. Plan: merge the estimated (historical NULL-multiplier) group with the recorded group once the fallback resolves to the same multiplier, inside buildLiteUsageBreakdown so it's covered by a unit test. Genuinely different multipliers stay separate rows.
Activity
pengzh1 commentedon Aug 27, 2026
Taking this. Plan: merge the estimated (historical NULL-multiplier) group with the recorded group once the fallback resolves to the same multiplier, inside
buildLiteUsageBreakdownso it's covered by a unit test. Genuinely different multipliers stay separate rows.