codex - 💡(How to fix) Fix [BUG] /goal loops after usage limit and repeatedly triggers compaction

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…

Root Cause

The issue does not seem to be caused by the usage limit and context compaction happening at exactly the same time initially. Instead, the observed sequence is:

Fix Action

Fix / Workaround

   You've hit your usage limit. Upgrade to Pro (https://chatgpt.com/explore/pro), visit    https://chatgpt.com/codex/settings/usage to purchase more credits or try again at 4:44 PM.
    ```

Code Example

You've hit your usage limit. Upgrade to Pro (https://chatgpt.com/explore/pro), visit    https://chatgpt.com/codex/settings/usage to purchase more credits or try again at 4:44 PM.

---

/goal running
5-hour usage limit reached
→ repeated usage-limit messages
→ context grows
→ compaction triggered
→ compaction hits the same usage limit
→ more usage-limit messages
→ context grows again
→ compaction triggered again
→ infinite loop
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

macOS Codex app 26.506.31421 (2620)

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Darwin 24.6.0 x86_64 i386

What issue are you seeing?

When using the experimental /goal feature, Codex App can enter an infinite loop after the 5-hour usage limit is reached.

<img width="879" height="476" alt="Image" src="https://github.com/user-attachments/assets/e899a760-afc5-458f-90dd-d641681d2a00" /> <img width="792" height="640" alt="Image" src="https://github.com/user-attachments/assets/7bc1f480-2d70-4a97-8756-835ef2b96d62" />

What steps can reproduce the bug?

The issue does not seem to be caused by the usage limit and context compaction happening at exactly the same time initially. Instead, the observed sequence is:

  1. I start a long-running task with /goal.

  2. The goal keeps running normally for a while.

  3. During the goal execution, the 5-hour usage limit is reached.

  4. Codex repeatedly prints the usage-limit message:

    You've hit your usage limit. Upgrade to Pro (https://chatgpt.com/explore/pro), visit    https://chatgpt.com/codex/settings/usage to purchase more credits or try again at 4:44 PM.
  5. Because the same usage-limit message is printed many times, the conversation context grows quickly.

  6. The large amount of repeated output appears to trigger automatic context compaction.

  7. The compaction step also requires a model request, but that request fails because the same 5-hour usage limit is still active.

  8. Codex then prints more usage-limit messages.

  9. Those additional messages appear to trigger compaction again.

  10. The session gets stuck in an infinite loop of usage-limit messages and failed compaction attempts.

In short, the loop appears to be:

/goal running
→ 5-hour usage limit reached
→ repeated usage-limit messages
→ context grows
→ compaction triggered
→ compaction hits the same usage limit
→ more usage-limit messages
→ context grows again
→ compaction triggered again
→ infinite loop

What is the expected behavior?

No response

Additional information

No response

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

codex - 💡(How to fix) Fix [BUG] /goal loops after usage limit and repeatedly triggers compaction