Skip to content

[BUG] Stuck subagents can't be nudged/restarted — Esc+Esc creates contextless replacement #32431

Description

@aqeelat

Description

When a subagent's LLM stops responding (gets stuck — happens with various models/providers, especially on long-running tasks), there is no way to nudge or retry within the existing subagent session.

The main-agent workaround doesn't work for subagents:

For the main agent, when the LLM stops responding, you can press Esc Esc to cancel and then type cont — the agent resumes with full context. This is a well-known and effective workaround.

For subagents, this doesn't work:

  1. Esc Esc cancels the stuck subagent
  2. Typing cont causes the main agent to interpret the cancellation as "subagent is done"
  3. The main agent spawns a brand new subagent with zero context of the previous one's work

All accumulated tool calls, file reads, and reasoning from the stuck subagent are lost. The parent agent has no access to the partial results.

This is especially painful when the subagent has been running for a long time (10+ minutes of exploration) and gets stuck near the end.

Plugins

None

OpenCode version

1.17.7

Steps to reproduce

  1. Launch a subagent that does substantial work (e.g., multi-file exploration with many tool calls)
  2. Wait for the subagent to get stuck (LLM stops responding — reproduces with models that have connection issues or rate limiting)
  3. Press Esc Esc to cancel the stuck subagent
  4. Type cont to try to resume
  5. Main agent creates a new subagent from scratch — previous subagent's session and work are inaccessible to both the user and the parent agent

Expected behavior

At minimum one of:

  • Nudge/retry: ability to retry the last LLM call within the same subagent session, preserving full context
  • Resume after cancel: cancelled subagent sessions should be viewable (related: cancelled subagents can't be opened in TUI) and their partial results should be available to the parent
  • Explicit restart: ability to restart a subagent within its existing session/context rather than spawning a fresh one

Screenshot and/or share link

N/A

Operating System

macOS

Terminal

TUI

Related issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions