Repository navigation
Description
What version of Codex is running?
Codex Desktop 26.826.12353 on Windows 11.
What happened?
Codex Desktop can enter an apparent infinite loop of repeated tool calls / repeated connection-status actions. Instead of completing the task or failing once, it keeps issuing the same tool-related action and printing the same status line many times.
This started suddenly between working sessions: the same setup worked the previous day, but after reopening Codex the next day the loop appeared. Restarting the PC did not resolve it.
The problem is not limited to one third-party MCP server:
- It was first observed while the Weppy Roblox MCP integration and Roblox Studio were connected.
- It continued after Weppy was disabled/disconnected.
- In one test, the same connection/status line was printed more than 10 times after the visible screenshot.
- Previously, the same flow normally connected within roughly 10–20 seconds, reported the active Roblox experience/mode once, and continued.
- The UI may also remain in a reconnecting state.
There were two Roblox-related MCP routes visible in the affected setup:
Roblox_Studio— 29 toolsweppy-roblox-mcp— 25 tools
Disabling the duplicate Roblox_Studio route and keeping only Weppy was tested/recommended during diagnosis, but the repeated-call behavior was also reproduced with Weppy disabled, so this does not appear to be solely a Weppy bug.
A separate Weppy startup attempt timed out after 30 seconds. Increasing MCP startup/tool timeouts may help that timeout, but it does not explain why Codex repeats the same action indefinitely instead of surfacing one error and stopping.
Steps to reproduce
The exact trigger is not fully deterministic, but the observed sequence is:
- Open Codex Desktop on Windows.
- Start a chat that uses MCP tools (in the original case, Roblox Studio / Weppy).
- Ask Codex to inspect or connect to the active Roblox Studio session.
- Observe Codex repeat the same tool call or connection/status action instead of continuing.
- Disable/disconnect Weppy and retry.
- In affected sessions, Codex can still repeat the same line/action many times or remain in a reconnecting loop.
Expected behavior
Codex should call a tool once, wait for its result, then either continue the task or surface a single timeout/connection error. It should detect identical repeated calls with no state change and stop the loop.
Actual behavior
Codex repeatedly issues the same tool-related action/status output, sometimes more than 10 times, without useful progress. The session may remain stuck until Codex is restarted or the run is manually stopped.
Frequency
Intermittent but repeatedly reproducible after it started. It affected both the original MCP-enabled setup and a test with Weppy disabled.
Regression?
Yes. The same setup and workflow worked the previous day. The issue appeared after reopening Codex the next day, without an intentional project/workflow change. A recent Codex Desktop update/regression is suspected, but the root cause is not confirmed.
Additional context
- OS: Windows 11
- Codex Desktop: 26.826.12353
- Third-party integration present during initial reproduction: Weppy Roblox AI Toolkit Pro
- PC restart did not fix it.
- Disconnecting Weppy did not eliminate the repeated-call behavior.
- Screenshots/video can be provided if maintainers need the exact repeated line and UI state.
This report intentionally does not claim Weppy or the recent update is the confirmed cause. The core Codex-side failure is the absence of loop detection/backoff when an identical tool action makes no progress.
Activity
gary23w commentedon Sep 4, 2026
Source-level comparison against current
main(99d66aa1c5f8394729a97a6eea91880fa420352b) reinforces that this is a Core/runtime gap, not only an MCP integration bug.Today the regular-turn controller decides continuation from
model_needs_follow_up || has_pending_input, then relies on compaction when the token limit is reached. The source comment explicitly assumes that successful compaction makes an infinite loop unimportant; there is no outcome-sensitive guard in that decision path:session/turn.rs#L441-L543. Compaction bounds context size, but it does not distinguish progress from a compacted repetition.A working open-source reference exists in nl-veil (disclosure: I maintain it):
engine.zig#L3210-L3216.engine.zig#L4251-L4260.engine.zig#L8318-L8344,engine.zig#L8397-L8409.engine.zig#L8646-L8688.A small Codex MVP could live below individual MCP/tool implementations:
(turn_id, canonical tool identity, argument digest, result digest, outcome class, mutation epoch).notExecuted: repeatedIdenticalOutcomeresult instead of invoking the tool.Useful regressions would cover: identical call + identical result; identical call + changed result; A/B tool cycling; duplicate calls emitted in one batch; read-after-write; intentional bounded poll/wait; and preservation of already-landed tool outputs when the guard stops the turn.
The important invariant is:
That would address the failure reported here without special-casing Roblox or any MCP server.