Skip to content

Codex App enters infinite execution loop after context compaction, wastes 2+ hours and exhausts usage limits #57006

Open

Description

@Alex0nder

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

26.1021.31345

What subscription do you have?

ChatGPT subscription ($100/month)

What platform is your computer?

Darwin 25.6.0 arm64 arm

What issue are you seeing?

Summary

Codex App entered a repetitive execution loop during a SwiftUI development task, repeatedly compacting its context, inspecting the same files, and announcing implementation steps without delivering a verified result.

The execution lasted 2 hours, 3 minutes, and 22 seconds before exhausting my usage limit.

I am paying $100/month for ChatGPT, and this incident consumed my available usage without completing the requested task.

Steps to reproduce

  1. Open an existing macOS SwiftUI project.
  2. Ask Codex to convert three existing modal views (Reports, Mail, and Profile) into full application pages accessible through the sidebar.
  3. Codex initially rebuilds and reinstalls the application without implementing the requested changes.
  4. Clarify that the navigation changes were not implemented.
  5. Allow Codex to continue working through automatic context compaction cycles.

Actual behavior

Instead of implementing the changes, Codex repeatedly:

  • Read the same Swift source files.
  • Searched for the same navigation symbols.
  • Announced that it was about to modify the navigation.
  • Promised to rebuild and reinstall the application.
  • Automatically compacted its context.
  • Restarted essentially the same investigation.

Repeated searches included:

showMail|showReport|showProfileSetup|sidebarUtility|detailContent

The agent repeatedly stated that implementation was underway or nearly complete, but the visible execution history showed no verified completion.

The execution eventually terminated with:

“You’ve hit your usage limit.”

The application indicated that usage would become available again on November 1, 2026, at 11:16 AM.

Expected behavior

Codex should:

  1. Preserve task state across context compaction.
  2. Detect repeated tool calls without meaningful progress.
  3. Prioritize actual code modifications over repetitive analysis.
  4. Verify progress through file diffs, builds, and tests.
  5. Stop execution when it cannot make progress.

Impact

  • Execution time: 2h 03m 22s
  • Subscription: $100/month
  • Context compaction: Repeated automatic compactions
  • Tool usage: Repeated file reads and nearly identical searches
  • Result: No verified implementation
  • Termination: Usage limit exhausted

This is not merely a coding error. It appears to be a failure of execution control, context management, and resource-consumption safeguards.

Requested action

Please investigate why Codex continued repeating the same operations across context compaction cycles without detecting the lack of progress.

I would also appreciate a review of the usage consumed during this failed execution and consideration of restoring the exhausted allowance.

I have an exported execution log containing the repeated operations and final usage-limit error.

What steps can reproduce the bug?

Reproduction steps

  1. Open an existing macOS SwiftUI project in Codex App.
  2. Ask Codex to convert three existing modal views (Reports, Mail, Profile) into regular pages within the application’s sidebar navigation.
  3. Allow Codex to inspect the existing navigation implementation.
  4. After an initial rebuild that does not contain the requested changes, explicitly ask Codex to implement the missing functionality.
  5. Allow the agent to continue autonomously through multiple automatic context compaction cycles.
  6. Observe the repeated file inspections, identical searches, and repetitive progress messages.

Repeated operations

Codex repeatedly searched for:

showMail|showReport|showProfileSetup|sidebarUtility|detailContent

The agent repeatedly inspected JobSearchModule.swift and related SwiftUI views.

After automatic context compaction, it returned to essentially the same investigation.

Result

The agent continued repeating operations for approximately 2 hours and 3 minutes without delivering a verified implementation.

The session eventually terminated with:

You've hit your usage limit.

Reproducibility

Observed in one extended execution session. Not independently reproduced in a fresh session.

Session ID and exact token consumption are not currently available.

The complete execution history can be provided in redacted form.

What is the expected behavior?

Codex should maintain a reliable record of task progress across automatic context compaction.

After inspecting the relevant files, the agent should proceed to implementation rather than repeatedly restarting the same investigation.

Expected behavior includes:

  1. Preserving completed analysis, pending changes, and known blockers across context compaction.
  2. Detecting repeated tool calls that produce no meaningful progress.
  3. Avoiding redundant file reads and identical searches.
  4. Reporting progress only when supported by actual code modifications.
  5. Verifying implementation through diffs, builds, and tests.
  6. Stopping execution and reporting a blocker when progress cannot be made.

The agent should not continue consuming a user’s usage allowance for hours while repeatedly announcing the same intended actions.

A failed task should terminate with a clear explanation rather than exhausting the available usage limit.

Additional information

Environment

  • Application: ChatGPT desktop app with Codex
  • Version: 26.1021.31345
  • Operating system: macOS / Darwin 25.6.0
  • Architecture: Apple Silicon (arm64)
  • Subscription: $100/month

Incident impact

The problematic execution lasted 2 hours, 3 minutes, and 22 seconds.

During this period, Codex repeatedly announced that it was implementing the requested changes while continuing to inspect the same source files.

The execution history contains numerous automatic context compaction events and repeated tool calls.

The final result was an exhausted usage allowance, with the application indicating that usage would become available again on November 1, 2026, at 11:16 AM.

Financial impact

I am paying $100 per month for access to this service.

A significant amount of my available usage was consumed by repetitive operations that did not produce a verified result.

This is particularly concerning because the agent did not detect the execution loop or stop before exhausting the usage allowance.

Requested investigation

Please investigate the interaction between automatic context compaction, execution-loop detection, and agent progress tracking.

I would also appreciate a review of the usage consumed during this failed execution and consideration of restoring the exhausted allowance.

A full execution history is available. I can provide a redacted log if needed.

Image [codex-execution-loop.md](https://github.com/user-attachments/files/33945320/codex-execution-loop.md) Image

Activity

  1. added
    app
    on Oct 26, 2026
  2. added
    bug
    context
    model-behavior
    on Oct 26, 2026
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

    appbugcontextmodel-behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions