[BUG] /goal loops after usage limit and repeatedly triggers compaction

Resolved 💬 2 comments Opened May 21, 2026 by roojay Closed May 21, 2026

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:

``text
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.
``

  1. Because the same usage-limit message is printed many times, the conversation context grows quickly.
  2. The large amount of repeated output appears to trigger automatic context compaction.
  3. The compaction step also requires a model request, but that request fails because the same 5-hour usage limit is still active.
  4. Codex then prints more usage-limit messages.
  5. Those additional messages appear to trigger compaction again.
  6. 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_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗