Codex Desktop can remain in Thinking after successful tool calls with no streamed follow-up or a hung /responses request
Summary
Codex Desktop can remain in the UI Thinking state after tool calls have already completed successfully. After inspecting local session JSONL and core SQLite logs across several affected turns, the visible Thinking state appears to cover multiple distinct backend states:
- A stale turn state after a successful tool result, with no further session events emitted until the user interrupts.
- A follow-up
/responsesrequest that is started after successful tool results but then produces no streamed output for several minutes, until the user interrupts. - Context compaction after tool output, which can look similar in the UI but does eventually resume.
- A long-running model request after tool output that eventually returns, also shown only as
Thinking.
This makes it hard to tell whether the model is actually reasoning, the backend request is hung, compaction is running, or the turn runner is stale.
Environment
Sanitized environment from affected runs:
- Product: Codex Desktop
- Client version observed in logs:
26.519.81530 - Core/app version observed in telemetry:
0.133.0 - OS: macOS, arm64
- Model:
gpt-5.5 - Reasoning effort:
xhigh - Approval policy:
never - Sandbox: full local access
- Auth mode: ChatGPT
Account identifiers, email addresses, exact local paths, thread IDs, and prompt contents have been intentionally omitted.
Observed Patterns
Case A: tool success followed by no session activity until interrupt
In one affected turn, the last tool call was an apply_patch that completed successfully. After the tool result was written, there were no further session JSONL events until the user interrupted several minutes later.
Sanitized event sequence:
T+0s custom_tool_call_output: apply_patch success
T+0s token_count
T+216s user interrupt
T+216s turn_aborted
During that interval there were no new session entries of these types:
reasoning
message
function_call
function_call_output
token_count
task_complete
This suggests the UI was still showing Thinking, but there was no visible evidence that the model was actively reasoning or that any new tool work was pending.
Case B: tool success followed by a follow-up /responses request that hangs
In another affected turn, multiple shell tools completed successfully. The runner then decided a model follow-up was required and started a new /responses request. No streamed output was produced for over eight minutes, until the user interrupted.
Sanitized session sequence:
T+0s function_call_output: success
T+0s function_call_output: success
T+0s function_call_output: success
T+0s token_count
T+492.7s user interrupt
T+492.7s turn_aborted
Relevant sanitized core log signal:
post sampling token usage
total_usage_tokens=117208
estimated_token_count=Some(96568)
auto_compact_scope_limit=244800
token_limit_reached=false
model_needs_follow_up=true
has_pending_input=false
needs_follow_up=true
stream_request: POST /backend-api/codex/responses
There was no Request completed log and no streamed reasoning, message, function_call, or token_count event before the interrupt.
This suggests this instance was not local tool execution and not visible local reasoning; it was a pending follow-up model request that did not produce output or a failure event for several minutes.
Case C: tool success followed by context compaction
A separate affected-looking interval was actually context compaction. In that case, tool output completed, then a context_compacted event appeared around 30 seconds later, and reasoning resumed shortly after.
Sanitized sequence:
T+0s function_call_output: success
T+0s token_count
T+~30s context_compacted
T+~35s reasoning resumes
This is less concerning functionally, but the UI still only showed Thinking, making it indistinguishable from the stuck cases above.
Case D: long follow-up request that eventually returns
Another case showed a post-tool follow-up /responses request taking around 149 seconds before returning. It eventually emitted reasoning, so it was not permanently stuck, but it looked identical to the hung case in the UI while waiting.
Sanitized signal:
POST /backend-api/codex/responses
Request completed: status=200, duration_ms=149510
reasoning emitted afterward
Expected Behavior
After tool calls complete successfully, Codex Desktop should avoid silently staying in Thinking indefinitely.
Ideally:
- If a follow-up model request is pending, the UI should distinguish "waiting for model response" from "reasoning".
- If a follow-up
/responsesstream produces no events for a long time, Codex should emit a timeout, retry, or visible recoverable error. - If the runner has
needs_follow_up=truebut no progress occurs, there should be watchdog logging and a task-level failure or recovery path. - If context compaction is running, the UI should identify that state separately.
- If no model request is pending and no events are emitted after tool success, the turn should not remain open without
task_complete,turn_aborted, or an error event.
Why this matters
From the user's perspective, all of these cases look like the same Thinking state after tools have already succeeded. The only practical workaround is to interrupt the turn and continue, but interruption can lose momentum and may leave turns in confusing states.
Agent-level instructions such as "after tool success, promptly respond" do not fix the hung cases because the model does not regain control while the follow-up request is pending or the runner is stale.
Potentially Related Issues
This may overlap with or provide more granular diagnostics for:
- #24336
- #21360
- #24571
- #24618
6 Comments
+1 to THIS!!!!!!! YES! PLEASE
I added a small detector for this exact report shape in
trace-to-skill@0.1.60:It is not a fix, just an evidence packer for reports like this. It looks for accepted turns or completed local tools followed by no streamed assistant follow-up, long gaps before the first
response_item,responses_http/ websocket close lines wheretime.busyis tiny andtime.idleis hundreds of seconds, Stop/Ctrl+C failures, MCP state, and subagent parent/child lifecycle evidence.The goal is to make future reports include the exact timing fields maintainers need without requiring people to paste entire private transcripts.
Additional reproduction evidence: Windows Desktop,
gpt-5.6-sol, post-tool continuation intermittently never resumesI am seeing what appears to be the same failure mode on a newer Windows Codex Desktop build and model. The important additional observation is that this can occur after ordinary local PowerShell/config inspection, without web search, Guardian review, subagents, MCP startup, compilation, or
git diff.Environment
OpenAI.Codex 26.707.9564.0codex-cli 0.144.2gpt-5.6-solhighHTTP_PROXY,HTTPS_PROXY, andALL_PROXY: not setChatGPT,codex, andcodex-code-mode-hostprocesses remained alive during inspectioncodex-cli 0.125.0; this is not the runtime used by DesktopUser-visible behavior
The UI remains on the last planning-status text, for example:
The operation described by that text is not actually still running. The last tool has already returned successfully, but there is no further reasoning item, tool call, final response, visible error, or terminal task state. The task continues to show as running until manually stopped, after which it becomes
interrupted.Observed samples
At least three affected turns have been observed:
All three turns required manual interruption. There was no evidence of a still-running shell command or app-server crash in the latest sample.
Likely failure boundary
The expected sequence is:
The affected turns fail after the tool result returns. It is not yet clear whether each sample is:
Historical local logs from the same installation include
stream disconnected, repeated retries followed by HTTP fallback, and WebSocket10054/10061errors. This confirms that response-stream instability has occurred, although it is not yet proven that every stalled turn has the same cause.Negative/minimal tests
Four clean, short, new-thread tests were run successfully:
Therefore the basic post-tool continuation path is currently functional and the bug appears intermittent or load/state dependent rather than deterministic per tool type.
Potential amplifiers in the failed runs include:
reasoning_effort = high;Factors not required for the latest reproduction
The latest case occurred without:
git diffpager;Expected behavior / diagnostic request
After a successful tool result, Desktop should not remain indefinitely in a generic planning/thinking state. It would help if the UI and durable logs distinguished:
A watchdog should eventually retry, surface a recoverable error, or terminate the turn instead of requiring manual interruption.
The newer Windows/runtime/model combination suggests that the problem reported here is not limited to the original macOS
0.133.0/gpt-5.5environment.Additional Windows reproduction from a ChatGPT Plus user.
Symptom
Codex Desktop repeatedly gets stuck indefinitely on
Thinkingduring a local Android/ADB automation task. In some runs, previous tool calls complete and the UI never resumes. In other runs, the follow-up prompt is accepted but no tool call, shell command, progress trace, or final answer appears for 5+ minutes.Important comparison
The same project and task work normally when Codex is used through Cursor on the same machine/account. This strongly suggests a Codex Desktop turn-state / streaming / renderer issue rather than a project, ADB, TikTok, device, or network problem.
Observed behavior
ThinkingExpected behavior
The desktop client should distinguish model reasoning, context compaction, a hung
/responsesstream, and a stale turn runner. It should also apply a watchdog/retry or surface an actionable error instead of remaining onThinkingindefinitely.Related evidence appears consistent with this issue and with the broader Desktop turn-state problems discussed in #25779. Screenshots are available if useful.
Codex Desktop: 26.721.41059
embedded codex: 0.146.0-alpha.3.1
model_provider: custom
wire_api: responses
model: gpt-5.6-sol / gpt-5.6-terra
behavior: tool completes successfully, then no assistant/tool events for 2–4 minutes; manual interrupt + “continue” immediately resumes
Additional macOS reproduction: 97-minute stall after a completed tool result and persisted
token_countI observed what appears to be the same post-tool continuation failure on a newer macOS Desktop runtime. This reproduction narrows the local failure boundary because the yielded background cell was explicitly awaited to completion, a subsequent standalone command also completed, and the final rollout event before the silent interval was
token_count.Environment
26.803.61601(build6396). This is the currently installed version and was not independently verified as the exact historical build at the time of the incident.codex-cli 0.147.0-alpha.6.5gpt-5.6-solxhighDarwin 24.5.0 arm64 arm01a01944-f25e-7683-999d-ec90383c44ef01a01947-465f-7f20-ba48-7e6e6b87cbb6Observed behavior
The agent was completing the final validation of a long Markdown research report.
Script running with cell ID 73.wait(cell_id=73), which returnedScript completedwith the expected output.wc -l -ccommand.759lines and72,727bytes.token_countevent was persisted immediately afterward.task_completeevent followed for approximately 97 minutes 28 seconds.Sanitized timeline (Asia/Singapore, UTC+8):