Estimate credits needed to finish an interrupted task before purchasing more credits
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What variant of Codex are you using?
Codex on desktop/PC. This request applies to App and CLI long-running tasks.
What feature would you like to see?
When a Codex task is interrupted because the included usage limit or purchased credits are exhausted, show an estimated amount of additional credits required to finish the current task before the user buys more credits.
The key question is not only "how much have I used?", but:
Approximately how many more credits will this existing task need to reach completion?
A range would be preferable to false precision, for example:
Task paused: usage limit reached
Estimated credits to finish: 180–320 credits
Confidence: medium
Assumes: GPT-5.6 Sol, Standard speed, current reasoning level, no additional subagents
Credits remaining: 75
Suggested additional credits: ~150–250
If Codex cannot produce a responsible estimate, it should explicitly say that the remaining cost is unknown rather than inventing a number.
Problem
Long-running coding tasks can stop halfway through because the usage window or credit balance is exhausted. At that point the user has no practical way to decide whether purchasing 100, 500, or 1,000 credits is appropriate.
Existing usage information is retrospective: it tells us what has already been consumed. That is useful, but it does not answer whether the remaining task is likely to require a small continuation or another large block of credits.
This is particularly important when the task already has substantial execution state: completed edits, remaining TODOs, tests still pending, known failures, planned validation, or active/subsequent subagents.
Suggested behavior
At a quota/credit interruption, Codex could estimate remaining cost using signals it already has or can derive conservatively, such as:
- credits/tokens already consumed by the current thread;
- recent per-turn burn rate;
- current model, reasoning effort and speed/service tier;
- remaining explicit plan/checklist items;
- tests, builds or validation steps still pending;
- expected context replay/compaction overhead;
- active or planned subagents;
- whether the remaining work is mostly implementation, verification, or investigation.
The result should be shown as a range plus confidence, not as an exact guarantee.
Possible confidence levels:
- High: bounded remaining steps and stable recent consumption.
- Medium: known remaining work but variable tool/test cost.
- Low: open-ended debugging/research or uncertain subagent fan-out.
- Unavailable: insufficient evidence for a useful estimate.
It would also help to expose the estimate in a command such as /status or /cost, for example:
Current thread usage: 420 credits
Estimated remaining: 180–320 credits (medium confidence)
Current balance: 75 credits
Estimated shortfall: 105–245 credits
Why this matters
Without a remaining-cost estimate, purchasing credits for an interrupted task is guesswork. Users either under-purchase and get interrupted again, or over-purchase without knowing whether the task actually needs that much capacity.
This would make credit purchasing and long-running agent work much more predictable without requiring Codex to promise an exact completion cost.
Relationship to existing work
This is related to, but more specific than:
- #21490 — asks for actual remaining quota and visibility into how much tasks cost.
- #40905 — describes long-running tasks being interrupted by usage limits.
- #38281 / #38282 — added estimated per-thread usage/cost surfaces for eligible workspaces.
Those features/issues focus primarily on quota visibility, historical/current thread cost, or interruption behavior. This request is specifically for a prospective estimate of the additional credits required to finish the already-running task.
Additional information
Accuracy does not need to be perfect. A conservative range with assumptions and confidence would already be much more useful than no estimate.
The estimate should clearly update if the user changes model, reasoning effort, Fast mode, subagent usage, or scope.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing per-thread usage and cost surfaces referenced in #38281 and #38282, along with interruption behavior from #40905. Trace the App and CLI entry points for /status or /cost; done means a conservative remaining-credit range, confidence, assumptions, and balance or shortfall are shown when evidence supports an estimate, with an unavailable result otherwise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100