Repository navigation
Description
Summary
A scan's estimated API-dollar cost does not measure remaining ChatGPT subscription allowance. During a long request, an unchanged estimate can also be mistaken for current usage. Operators need to see both the meaning of the measurement and whether it includes active work.
Current status — 19 October 2026
- fix: coalesce cost polling without changing tracker API #198 fixed a polling backlog.
- fix(cli): improve scan usage and cost reports #853 improved token reporting, and fix(cost): report context-aware estimate ranges #926 added pricing ranges and assumptions.
- fix(dashboard): keep dashboards responsive and show observed usage #1276 improved live usage display and dashboard responsiveness.
- The current cost documentation explicitly distinguishes API-price estimates from ChatGPT allowance.
The remaining work is allowance visibility when the runtime provides it, clear handling when it does not, and an indication that usage measurements are stale or incomplete. #1640 is a related open proposal for usage freshness.
Original observation
Reported on CLI 0.1.1, macOS, Node 22.23.1, npm 10.9.8, using stored ChatGPT credentials and a Deep Scan with gpt-5.6-sol / xhigh.
codex-security scan /path/to/repository \
--mode deep \
--model gpt-5.6-sol \
--codex 'model_reasoning_effort="xhigh"' \
--output-dir /path/outside/repository/results \
--max-cost 10The estimate updated regularly at first, reaching $0.591838 of $10.00 limit at 02:03. It then remained unchanged until the scan was canceled at approximately 42:47, while the weekly allowance shown in the ChatGPT usage interface was exhausted.
The expensive model/settings were intentional. The problem was the lack of information needed to decide whether to continue or cancel, rather than the mere fact that the scan consumed substantial usage.
Control observation
A later Standard scan using gpt-5.6-terra, medium effort, and --max-cost 0.25 stopped with:
Estimated cost: $0.25063 of $0.25 limit
codex-security: Scan stopped: estimated cost $0.25063 exceeded the $0.25 limit
This does not establish that the USD limiter failed during the earlier run. Missing in-flight measurements and subscription-allowance accounting are separate concerns.
Remaining expectations
- Show when a displayed estimate was last updated and whether an active request's usage is still pending.
- Distinguish observed usage from missing or unavailable usage; avoid presenting an unchanged estimate as a current reading.
- Show plan-allowance information when available, or clearly state that it cannot be determined.
- Keep
--max-costsemantics separate from a subscription-allowance cap.
Allowance-based stopping controls were suggested in the discussion, but require a supported runtime signal and a separate design decision. Related: #25 for pre-spend planning and #70 for progress independent of cost.
Activity
mariohercules commentedon Jul 29, 2026
A possible mechanical explanation for the frozen estimate, offered as a hypothesis rather than a diagnosis: this looks like it could be #31.
ScanCostTrackeronly starts polling whenmaxCostUsdis set, which is the case here (--max-cost 10). Per #31, each 100 ms tick chains another full session-tree pass onto#pendingwithout coalescing, and every pass re-enumerates$CODEX_HOME/sessionsand opens each.jsonlit finds. Once a single pass takes longer than the interval, the queue grows without bound and cost updates fall progressively further behind.Three details in this report line up with that shape:
--mode deep, which delegates to many worker threads. Each one adds session files, so the per-pass cost grows over the life of the scan — the backlog gets worse precisely as the scan goes on.--max-cost 10limit never fired even though the weekly allowance was exhausted. The abort is driven by the sameonCostpath that stopped reporting, so if the callback is starved, the limit cannot be enforced on time.If that is what happened, then the two things in this report have different fixes. The visibility gap you describe — the CLI never explaining how a USD estimate relates to a ChatGPT plan allowance — is a real and separate documentation/UX problem, and worth keeping this issue open for. But the estimate freezing and the budget limit not firing would be a straightforward bug rather than a reporting-granularity choice.
One caveat: I have not reproduced your specific run, and a genuinely stalled scan would look similar from the outside. What would distinguish the two is whether the scan was still making progress while the estimate was frozen — for example whether the scan directory's artifacts were still being written during those 40 minutes.
agus-castro commentedon Jul 29, 2026
Thanks for the hypothesis. I checked the available local evidence.
The partial output directory is empty. The persisted scan details currently show:
After the last cost update at approximately 02:03, the CLI continued displaying the elapsed Running scan timer until I canceled it at 42:47. It did not report any further cost, phase, worker, or coverage updates.
Therefore, I cannot confirm that the scan was still making progress while the estimate was frozen. It may have been stalled, or it may have been processing a long-running request without writing intermediate artifacts.
One clarification regarding --max-cost 10: exhausting the ChatGPT weekly allowance does not establish that the CLI's USD-equivalent estimate reached $10, since those metrics are not directly comparable. The issue I observed is that the estimate remained stale, so I could not determine the current estimated usage or make an informed decision about continuing the scan.
The behavior is compatible with the mechanism described in #31, but the available evidence is not sufficient to confirm that #31 caused this specific run.
mldangelo-oai commentedon Aug 15, 2026
#198 fixed the polling backlog, but API-equivalent USD estimates still do not explain ChatGPT allowance consumption or whether usage data is current. Keeping this open for that remaining distinction.
mldangelo-oai commentedon Oct 8, 2026
Merged #853 improves token reporting, and #926 adds pricing ranges and assumptions. Open #1276 improves live usage display. None provides remaining ChatGPT allowance, so that part is still open.
[-]Improve ChatGPT allowance visibility during long-running scans with stale estimated cost[/-][+]Show usage freshness and ChatGPT allowance limits during long-running scans[/+]