Do not interrupt an active Codex task when the 5-hour usage limit is reached
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.825.51511
What subscription do you have?
ChatGPT Plus
What platform is your computer?
macOS
What issue are you seeing?
Codex stops an active coding task immediately when the 5-hour usage limit is reached, even if the task was started while usage was still available.
This can leave the repository in a partially modified and unvalidated state. Previously, active tasks appeared to be allowed to finish before further usage was blocked.
I would expect Codex to let the currently running task reach a safe completion point and only block the next task after the usage limit is exhausted.
What steps can reproduce the bug?
- Use Codex normally until the remaining 5-hour usage quota is low (for example, around 5–10%).
- Start a coding task that requires multiple steps, such as modifying several files, running tests, and validating the implementation.
- Let Codex continue working until the 5-hour usage quota reaches 0%.
- Observe that Codex stops the active task immediately when the quota is exhausted.
- The task may stop after code changes have already been made but before tests, validation, fixes, or the final completion step are finished.
Expected behavior:
If a task was accepted and started while usage was still available, Codex should allow that active task to reach a safe completion point and only block starting the next task.
What is the expected behavior?
If Codex starts a task while usage quota is still available, the active task should be allowed to reach a safe completion point even if the 5-hour usage limit is reached during execution.
Codex should then block the next task or prompt until the usage window resets.
Ideally, any usage beyond the current window could be deducted from the next window, or Codex could reserve enough quota before starting a long task. The important behavior is that an active repository-changing task should not be interrupted halfway through implementation or validation.
Additional information
This behavior is especially disruptive for long-running agentic coding tasks.
A Codex task may modify many files before reaching the testing and validation stages. If the usage limit interrupts execution at that point, the repository can be left in a partially implemented state with no final validation or completion summary.
This also makes the remaining usage percentage difficult to rely on. Even when Codex accepts a task while quota is still available, there is currently no clear indication that the task may be terminated before completion.
I am not necessarily asking for the 5-hour limit to be removed. The main request is to avoid interrupting a task that has already been accepted and is actively modifying the repository.
Possible approaches could include allowing the active task to finish and deducting excess usage from the next window, reserving quota when the task starts, or warning/blocking the task before execution if there is insufficient quota to complete it safely.
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
No files or tests are named. Start by tracing the 5-hour quota check at task start and during execution; confirm an accepted task can reach a safe completion point while a subsequent task is blocked after exhaustion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100