Skip to content

Agent stalls during long thinking blocks and plan→build mode transitions #25094

@zj247647898

Description

@zj247647898

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 planbuild mode
  • 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

  1. 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."

  2. Mode transitions may drop the render loop — The plan → build transition involved a system reminder injection mid-response, which appeared to coincide with the stall.

  3. Related to existing issues: This may overlap with:

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
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions