Skip to content

Feature Request: Auto-resume CLI session when usage limit resets #21073

Description

@ndycode

What variant of Codex are you using?

CLI

What feature would you like to see?

When Codex hits the usage limit mid-task, the error already tells me exactly when the quota resets (e.g. "try again at 6:34 AM"). If that reset time falls while I'm asleep, the information is wasted — the task just dies and waits for me to wake up, find the session, and re-issue the prompt.

Image

I'd like Codex to automatically continue the session at the reset time, without me being there.

Behavior:

  1. Turn fails with usage limit reached.
  2. Codex reads the reset time it already knows about (resets_at in UsageLimitReachedError).
  3. Instead of erroring out, Codex sleeps until that time and then re-runs the same turn.
  4. I wake up to a finished or in-progress task instead of a frozen one.

Why this is basically free to implement:

The reset timestamp is already structured data in the protocol (codex-rs/protocol/src/error.rs → UsageLimitReachedError.resets_at) and the session already updates rate limits on this error (codex-rs/core/src/session/turn.rs ~line 1075). Today we just throw the timestamp away and crash the turn. The ask is: use it.

Make it opt-in so nothing changes for existing users:

codex --auto-resume-on-limit

or in ~/.codex/config.toml:

[usage_limits]
auto_resume = true

That's it — that's the feature.

Additional information

The screenshot shows the exact message in question: "try again at 6:34 AM". I was asleep at 6:34 AM. The agent could have just kept going.

Related: #15788 covers the App-side queueing of new prompts on usage limit. This is the CLI/session-resume sibling — same idea, different surface.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestenterpriseEnterprise features like OTEL, RBAC, proxy servers, etc.rate-limitsIssues related to rate limits, quotas, and token usage reporting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions