-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Ultra-mode Terra and Sol sessions can overcount forked context #2037
Copy link
Copy link
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
CodexBar appears to overstate usage for
gpt-5.6-terraand especiallygpt-5.6-solwhen they run in Ultra mode.The pricing is correct: models.dev reports the correct input, cached-input, output, and long-context rates for these models. The inflation seems to be coming from usage accounting. Ultra sessions can fork multiple agents and replay large portions of the parent context while interleaving cumulative token snapshots.
In one local Sol session, the raw log reached roughly 268M cumulative input tokens, while CodexBar attributed 3.29B input tokens and about $4,000 of standard cost. A single forked turn contributed more than 3B tokens across hundreds of rows. The cache marked the file as having divergent totals, which is consistent with multiple cumulative-token lineages being mixed together.
Potential fixes include:
last_token_usagedeltas only when cumulative totals are unavailable or trustworthy; otherwise use cumulative deltas per lineage.The goal is to preserve genuine Ultra usage while preventing replayed fork context from being counted repeatedly. This is may be related to #1062 and #1138, but appears to be a distinct current failure involving interleaved Ultra-mode task counters.