Repository navigation
Codex Desktop stalls 90-120s after completed tool calls in long Windows MCP/image-heavy sessions #24738
Description
Summary
Codex Desktop can stall for 90-120 seconds after a tool call has already returned in a long Windows session. The local command itself is fast, but the agent loop does not continue to the next response/action for a long time.
This makes a simple file/report operation appear to take several minutes, even though the filesystem/tool operation completed in under a second.
Environment
- Product: Codex Desktop
- Platform: Windows
- Shell: PowerShell 7 (
pwsh) - Session log CLI version:
codex-cli 0.133.0 - Model shown in session context:
gpt-5.5 - Session type: long creative-production thread with image-generation history, MCP/tool usage, and large local session history
- Workspace: local Windows filesystem
What happened
In a long active session, I asked Codex to move/copy two generated PNG files into a human-facing report folder.
The underlying local commands were fast:
- A failed PowerShell copy command returned in about
0.6s. - A later successful copy command returned in about
0.5s. - The formal report-basket harness commands later completed in roughly
0.03-0.58seach.
However, the agent did not continue promptly after some tool results.
Evidence from local Codex session JSONL
The relevant timing gaps were measured from the local session JSONL timestamps.
Stall 1: after completed local command
19:48:51.341:exec_commandcall emitted for a simple PowerShell file-copy/report operation.19:48:51.937:exec_commandresult returned with an error. The tool itself completed in about0.6s.19:50:50.542: user interrupted the turn.
Gap after tool result before interruption: about 118.6s.
During this gap there was no additional tool call. The issue was not filesystem copy latency; the tool result was already available.
Stall 2: after completed MCP/context call
19:52:00.971:creative_contextcall emitted.19:52:01.258: MCP result returned. The MCP call itself completed in about0.23s.19:53:34.141: next response item / interruption point.
Gap after MCP result: about 92.9s.
Again, the tool/MCP call had already completed. The stall happened between tool-result ingestion and the assistant's next useful action.
Later non-stalled commands
When the correct report-basket harness was used later, the actual commands were fast:
- report harness: about
0.58s - file listing / mojibake scan / log listing: about
0.03-0.47s
So the observed slowdown was not caused by local file I/O.
Expected behavior
After a tool result returns, Codex should promptly continue with one of:
- summarize the tool result,
- retry/fix the failed command,
- ask the user for a decision,
- or continue to the next planned tool call.
A completed tool result should not lead to a silent 90-120s stall.
Actual behavior
Codex Desktop/agent loop appeared to hang after tool output was available. From the user's perspective, a simple file operation looked like a multi-minute operation even though the command had already completed.
Why this matters
This is painful in production workflows because it makes users misdiagnose the bottleneck as:
- filesystem performance,
- MCP server latency,
- PowerShell latency,
- local harness problems,
- or user workflow mistakes.
The trace suggests the real bottleneck is post-tool-result continuation inside Codex Desktop / the agent loop.
Related observations
Other users have also reported long-session / compaction / heavy-context slowdowns. This may be related to existing reports about Codex Desktop becoming slow in image-heavy or MCP-heavy sessions and context compaction taking a very long time.
Request
Please investigate post-tool-result stalls in long Windows Codex Desktop sessions, especially when the session contains:
- large conversation history,
- image-generation artifacts,
- MCP/tool calls,
- context compaction events,
- and local session JSONL/state files.
It would help a lot if Codex Desktop exposed per-turn timing diagnostics that separate:
- model reasoning latency,
- tool execution latency,
- tool-result ingestion latency,
- context compaction / hydration latency,
- renderer/UI latency,
- local state/sqlite write latency.
That would make it much easier to tell whether a delay is caused by the user's command, MCP, local filesystem, model queueing, or Codex Desktop itself.
Activity
github-actions commentedon May 27, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Q0916 commentedon May 27, 2026
Additional context: I’m reporting this with the help of Codex, which extracted the timing evidence from the local session JSONL. I may not be able to answer every implementation-level question, but I can provide additional logs or reproduce the workflow if needed.
This may overlap with other long-session / context-compaction / MCP performance reports, but I opened it separately because the local timestamps show the stall occurring after tool results had already returned. If maintainers consider this a duplicate, feel free to close or link it; I’m happy to add the timing evidence to the canonical issue instead.
Q0916 commentedon May 27, 2026
Additional evidence before closing:
The same long session later reproduced the post-tool-result stall pattern with longer gaps:
20:01:39.163: Creative Memory context result returned.20:07:19.867: next response item.And again:
20:08:03.919: parallel file-read tool results had all returned.20:17:54.408: next response item / interruption.The underlying local commands still completed quickly. This further suggests the delay is not file I/O, PowerShell, or MCP runtime, but happens after tool-result ingestion and before the agent continues.
Closing this for now because I may not be able to actively follow up with more diagnostics. The timing evidence above is left here in case it helps future investigation.
Q0916 commentedon May 27, 2026
Closing after adding the additional timing evidence above.
fongryan commentedon Aug 26, 2026
macOS reproduction with stronger persisted-state evidence (Codex Desktop 26.818.61809, Aug 25–26, 2026).
Observed:
functions.execorchestration cell awaited nested tools and repeatedly yieldedScript running with cell ID ...every ~31 seconds without resolving.exec_command, workspace dependency discovery, GitHub fetch, web search, and context search.functions.execcompleted immediately, so the isolate itself remained responsive.Persisted local evidence from
~/.codex/thread_history_1.sqlite:status=completed,exitCode=0, withdurationMs=0–1092.Desktop log evidence:
mcp_request_timeout ... pendingCount=5 ... timeoutMs=30000Cancellation finding:
functions.execcell awaiting nestedexec_command("/bin/sleep 15").pgrepstill shows both the wrapper and/bin/sleep 15alive.So terminating the outer orchestration cell does not propagate cancellation to the nested tool/process. Repeated terminate-and-retry can leave work behind and may worsen bounded-worker or queue pressure.
Expected:
functions.execpromise promptly.I can provide redacted SQL queries or timestamp extracts if maintainers need them.
fongryan commentedon Aug 26, 2026
One recovery correlation that may help narrow the owning path:
26.818.61809and primary runtime bundle26.819.11345, so recovery was not caused by a runtime-version change.2026-08-26T03:24:08Z, the desktop log recordedplugin_uninstall_succeeded pluginId=claude-mem@claude-mem-local.claude-mem/mcp_searchtools remained.This is temporal correlation, not proof of causation. I did not reinstall the plugin because deliberately re-wedging the active task would be unsafe. It may be useful to inspect whether plugin uninstall/reconcile rebuilds or clears a completion-dispatch table that can otherwise retain a stale callback/session.
fongryan commentedon Aug 26, 2026
Live deterministic repro in the same macOS task after the earlier comment:
functions.execcell sequentially awaited/usr/bin/true, workspace dependency discovery, and GitHub fetch.thread_itemsrow for the first and only reached nested call shows:/bin/zsh -c /usr/bin/truecompleted00 msawaitnever settled.exec_commandquerying SQLite completed in 0.3 seconds.This pins the defect to intermittent result forwarding from an already-completed nested tool into its enclosing
functions.execpromise/cell. It is not slow shell execution, model continuation latency, or a specific MCP backend.It also falsifies the removed
claude-memplugin as the sole cause: the plugin remained absent, the registry contained 312 tools, and the defect still reproduced. Plugin teardown may have temporarily reset the affected state, but it is not a complete fix.fongryan commentedon Aug 26, 2026
Additional app-level routing evidence from the same desktop session:
Around
2026-08-26T03:28:16Z–03:28:25Z, the desktop log repeatedly recorded:Received turn/started for unknown conversationReceived item/started for unknown conversationReceived item/completed for unknown conversationThose events referenced another active conversation, not the task used for the live repro, so I am treating them as app-wide correlation rather than claiming they are the exact dropped callback. Still, an
item/completedevent losing its conversation destination is structurally consistent with the observed nested tool item being persisted as completed while its enclosingfunctions.execpromise never settles.This points maintainers toward the event correlation/routing layer (conversation, turn, item, and nested-tool callback ownership), especially around task resume and concurrent thread restoration, rather than shell execution or an individual MCP server.