codex - 💡(How to fix) Fix [BUG] Session with `usage_limit_exceeded` becomes completely unopenable in VSCode — history is intact on disk but UI refuses to load it [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20006Fetched 2026-04-29 06:23:50
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×1

Error Message

  1. The session terminates with error: "codex_error_info": "usage_limit_exceeded" and message: "You've hit your usage limit... try again at 5:54 PM" The last events in the JSONL show the exact error: "type": "error",
  • #19558 — Thread broken by compaction failure, not by rate limit error
  1. Session state (error, rate limited, etc.) — this should only block new API calls

Root Cause

  • #19918 — Same 5-hour rate limit, but about the usage counter being wrong, not about session being unopenable
  • #16817 — "Threads don't load after restart" but for Mac Desktop App, no rate limit involved
  • #17354 — "Thread history wiped in app, present in CLI" but different root cause
  • #19558 — Thread broken by compaction failure, not by rate limit error

Fix Action

Fix / Workaround

{
  "type": "event_msg",
  "payload": {
    "type": "error",
    "message": "You've hit your usage limit. Upgrade to Pro (...), visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at 5:54 PM.",
    "codex_error_info": "usage_limit_exceeded"
  }
}

Code Example

~/.codex/sessions/2026/04/28/rollout-2026-04-28T12-53-55-019dd3b9-631a-7c71-ab84-087b02c7d125.jsonl
Size: 2.6 MB
Events: 1344
Messages: 108
Token usage: 24,655,646 total (24.5M input + 97K output)

---

{
  "type": "event_msg",
  "payload": {
    "type": "error",
    "message": "You've hit your usage limit. Upgrade to Pro (...), visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at 5:54 PM.",
    "codex_error_info": "usage_limit_exceeded"
  }
}

---

{
  "id": "019dd3b9-631a-7c71-ab84-087b02c7d125",
  "thread_name": "Revisa tokens desde el domingo",
  "updated_at": "2026-04-28T10:54:11.894692851Z"
}
RAW_BUFFERClick to expand / collapse

What version of the IDE extension are you using?

openai.chatgpt 26.422.62136 (VSCode extension)

What subscription do you have?

Plus

Which IDE are you using?

VS Code

What platform is your computer?

Ubuntu Linux 6.17 (amd64)

What issue are you seeing?

When a Codex session hits the usage limit and terminates with usage_limit_exceeded, the entire conversation history becomes inaccessible from the VSCode UI. The session file exists on disk and contains all messages intact, but Codex refuses to open it — it simply doesn't appear or load in the history panel.

Expected behavior: The rate limit should only block NEW messages (API calls). Viewing past conversation history is a local read operation — the session JSONL file is stored locally and should always be readable regardless of rate limit status.

Actual behavior: The session is completely blocked. Older sessions that ended cleanly (without errors) open fine.

Steps to reproduce

  1. Use Codex in VSCode on a Plus plan
  2. Have a long/intense session that consumes the 5-hour rate limit window (~24.6M tokens in my case)
  3. The session terminates with error: "codex_error_info": "usage_limit_exceeded" and message: "You've hit your usage limit... try again at 5:54 PM"
  4. Close VSCode
  5. Reopen VSCode → the session is gone from the history / cannot be opened
  6. Older sessions (without errors) open fine

Evidence from disk

The session file exists and is fully intact:

~/.codex/sessions/2026/04/28/rollout-2026-04-28T12-53-55-019dd3b9-631a-7c71-ab84-087b02c7d125.jsonl
Size: 2.6 MB
Events: 1344
Messages: 108
Token usage: 24,655,646 total (24.5M input + 97K output)

The last events in the JSONL show the exact error:

{
  "type": "event_msg",
  "payload": {
    "type": "error",
    "message": "You've hit your usage limit. Upgrade to Pro (...), visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at 5:54 PM.",
    "codex_error_info": "usage_limit_exceeded"
  }
}

The ~/.codex/session_index.jsonl also contains the session entry:

{
  "id": "019dd3b9-631a-7c71-ab84-087b02c7d125",
  "thread_name": "Revisa tokens desde el domingo",
  "updated_at": "2026-04-28T10:54:11.894692851Z"
}

Why this is a distinct bug

I checked existing issues. Related but different:

  • #19918 — Same 5-hour rate limit, but about the usage counter being wrong, not about session being unopenable
  • #16817 — "Threads don't load after restart" but for Mac Desktop App, no rate limit involved
  • #17354 — "Thread history wiped in app, present in CLI" but different root cause
  • #19558 — Thread broken by compaction failure, not by rate limit error

None report: session blocked from UI specifically because it ended with usage_limit_exceeded.

Suggested fix

The session loader should distinguish between:

  1. Session state (error, rate limited, etc.) — this should only block new API calls
  2. Session data (messages, tool calls, outputs) — local data should always be viewable

A session that ended with usage_limit_exceeded should still be openable in read-only mode. The UI could show a banner "Rate limit reached — read-only mode" but must render the conversation history.

extent analysis

TL;DR

The session loader should be modified to distinguish between session state and session data, allowing local conversation history to be viewable even when a session has ended with a usage_limit_exceeded error.

Guidance

  • Review the session loader logic to ensure it separates session state from session data, enabling read-only access to local conversation history.
  • Modify the UI to display a "Rate limit reached — read-only mode" banner when a session has ended with usage_limit_exceeded, while still rendering the conversation history.
  • Verify that the session file exists and is intact on disk, as shown in the ~/.codex/sessions directory, to confirm that the issue is not with data storage.
  • Check the ~/.codex/session_index.jsonl file to ensure the session entry is present, indicating that the session is recognized by the system.

Example

No code snippet is provided as the issue requires a logical change to the session loader and UI, rather than a specific code fix.

Notes

This solution assumes that the issue is specific to the session loader and UI, and that the underlying data storage is functioning correctly. If the issue persists after implementing these changes, further debugging may be required.

Recommendation

Apply workaround: Modify the session loader to enable read-only access to local conversation history when a session has ended with usage_limit_exceeded, as this will allow users to view their conversation history while preventing new API calls.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING