Repository navigation
[FEATURE]: Sub-agent abort recovery — show task_id and allow retry #24756
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
When a sub-agent is aborted (connection drop, crash, Ctrl+C, or system shutdown), the TUI shows "Tool execution aborted" with no actionable information. The user has no way to:
- Identify which child session was running (no task_id / session ID visible)
- Resume the aborted sub-agent (no retry action available)
The child session still exists in the database with its full message history, and the Task tool already supports resumption via task_id — but the UX provides no path to use it.
This is especially painful for long-running sub-agents (complex implementations, multi-file refactors) where losing 5-10 minutes of work to a transient connection issue is a real problem.
Current behavior
┃ General Task — Implement authentication module
┃ Tool execution aborted
No session ID. No retry option. The user must start over or manually dig through session data.
Proposed solution - Display task_id on aborted Task tool parts (quick win, ~5 lines)
The data is already available — metadata.sessionId is preserved by the abort handler in processor.ts (it spreads existing metadata and adds interrupted: true). The Task component in session/index.tsx just doesn't render it in the error state.
┃ General Task — Implement authentication module
┃ └ task_id: ses_0191a3b4c5d6AbCdEfGhIj
┃ Tool execution aborted
This alone makes manual recovery possible (user can tell the parent agent to resume with that ID). - "Retry" action on aborted Task tool parts (the real feature)
A keybind (e.g., r when focused on an aborted tool part) that re-invokes the Task tool call with the same parameters plus task_id injected automatically. The child session continues where it left off and the result flows back to the parent naturally.
This approach:
- Uses the existing task_id resumption mechanism in tool/task.ts
- Maintains the parent ↔ child relationship (result returns to parent)
- Doesn't depend on LLM interpretation of a text prompt
- Could be extended to a generic "retry aborted tool" mechanism in the future
Key implementation details - Abort preserves metadata (processor.ts ~L506): metadata: { ...metadata, interrupted: true } — so sessionId is always available
- Task tool supports resumption (tool/task.ts ~L63): when task_id is provided and the session exists, it reuses it with full history
- Click-to-navigate already works: the Task component's onClick navigates to the child session via metadata.sessionId — the data path is proven
Related issues - TaskTool returns no diagnostic context when subagent result text is empty or missing #24447 — TaskTool returns no diagnostic context when subagent result is empty (proposes showing child session ID)
- Opencode hangs indefinitely if exited during waiting for subagents to finish #24391 — OpenCode hangs if exited during subagent execution (the abort scenario)
- Main & Sub-agents Randomly Freeze Indefinitely: Frontend Permanently Shows "thinking" with No Errors, While Actual LLM Inference Has Already Terminated Prematurely #24342 — Sub-agents randomly freeze with no recovery path
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Apr 28, 2026
This issue might be a duplicate of existing issues. Please check:
github-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.