Repository navigation
Closed
Description
Description
During an extended interactive coding session (red-blue adversarial review with large file writes ~300 lines), two distinct stalls occurred where the agent appeared frozen with no user-visible output:
Stall 1: plan → build mode transition
- The session was in
plan(read-only) mode reviewing a 353-line markdown file - User prompted to continue → system transitioned from
plan→buildmode - Agent entered an internal reasoning block (
<thinking>) but output zero visible content for an extended period - The TUI showed no indication that processing was ongoing — appeared completely frozen
- User had to prompt "??????" twice to get a response
Stall 2: Long thinking block with no streaming
- Agent was verifying claims against source code (multiple parallel tool calls)
- After tool results returned, agent entered a long reasoning block synthesizing ~9 complex findings
- Again, zero visible output — TUI appeared hung
- User eventually got a response after the thinking block completed
Environment
- OS: Linux
- Shell: bash
- Model: deepseek-v4-pro (via API, thinking mode enabled)
- TUI mode: terminal CLI
Likely causes
-
Thinking blocks produce no streaming output — When the model enters an extended
<thinking>phase (30+ seconds), the TUI shows no progress indicator, spinner, or "thinking…" message. Users cannot distinguish between "model is thinking" and "process is hung." -
Mode transitions may drop the render loop — The
plan → buildtransition involved a system reminder injection mid-response, which appeared to coincide with the stall. -
Related to existing issues: This may overlap with:
opencode runhangs after completing tool calls — process never exits #17516 (opencode run hangs after completing tool calls)- Explore subagent hangs indefinitely with Anthropic Claude Opus 4.6 -- no timeout or recovery #13841 (subagent hangs indefinitely, no timeout or recovery)
- TUI freezes for ~10 seconds periodically on WSL2 (regression in v1.0.129) #5361 (TUI freezes periodically)
Suggested fix
- Show a visible "thinking…" indicator during reasoning blocks longer than 5 seconds
- Add a recovery timeout — if no streaming tokens for >60 seconds, surface a warning to user
- Ensure mode transitions (plan↔build) don't interrupt the render loop
Session details
- Task: Blue team defense responding to red team prompt audit (9 vulnerabilities, 2 rounds, ~600 lines of analysis)
- Files created:
docs/blue-team-prompt-round1.md(~280 lines),docs/blue-team-prompt-round2.md(~350 lines) - Total tool calls: ~20 across both rounds
- Both stalls occurred at synthesis/thinking phases, not during tool execution
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Apr 30, 2026
This issue might be a duplicate of existing issues. Please check:
opencode runhangs after completing tool calls — process never exits #17516:opencode runhangs after completing tool calls (related hang/stall behavior).If this is distinct (e.g., specifically triggered by thinking blocks or plan→build mode transitions rather than tool-call loops), please clarify the differences so this can be tracked separately.
zj247647898 commentedon Apr 30, 2026
Thanks for the quick triage. This is distinct from the referenced issues in a few ways:
Distinction from #13841: #13841 describes a stall after tool calls complete (tool-call loop hang). This issue is about stalls before tool calls start — specifically during the model's internal
<thinking>reasoning phase. In both stalls, tool calls had already completed and the model was synthesizing output. The spinner was not animating at all (TUI appeared frozen, not just the spinner marker spinning).Distinction from #18723: #18723 is about the UI freezing generally. This issue specifically identifies the trigger: mode transitions (
plan → buildwith system reminder injection) and extended thinking blocks (30+ seconds) without any streaming output reaching the TUI.Specific triggers observed in the session:
plan → buildtransition coinciding with a mid-response system reminder — the mode switch interrupted what would normally be a streaming continuation<thinking>block with zero output tokens reaching the TUI for 30+ secondsTo reproduce: Use deepseek-v4-pro (or any model with thinking/reasoning enabled) on a complex multi-file task. Trigger a plan→build transition by asking to continue after a long plan-mode analysis. The stall occurs between tool call result delivery and the next user-visible output.
skywalker-35 commentedon May 9, 2026
Can confirm this on Windows 11 + Windows Terminal, deepseek-v4-pro, v1.14.30.
Both stall patterns reproducible:
The suggested fix (thinking indicator + 60s timeout warning) would dramatically improve the experience. Even a simple spinner or elapsed-time counter during silent reasoning would help.
PierrunoYT commentedon May 12, 2026
I'm experiencing the same issue on Windows (PowerShell). Claude Sonnet 4.6 with medium thinking enabled is essentially unusable in OpenCode — the model gets stuck planning in the thinking trace and never executes the actual tool calls.
simonklee commentedon Jun 24, 2026
Thanks for the report. I can not reproduce this on the current dev revision (OpenCode 1.17.9).
We tested an existing session after each of these changes:
In every case, Enter submitted the text successfully using the newly selected agent/model/variant.
OpenCode 1.15.10 also silently ignored prompt submission errors while clearing the input. Newer versions display a Failed to send prompt error instead, so the original behavior may have been a rejected request rather than Enter being swallowed.
Could you retest with OpenCode 1.17.9 or newer and re-open if issue still persists?