[Bug] Subagent terminal command completion event lost — causes indefinite hang during Run All Tasks
Description
When "Run All Tasks" dispatches a subagent (spec-task-execution) that runs a terminal command (e.g. npx vitest run), the terminal command completes successfully but its completion signal is never propagated back to the subagent, causing the entire execution to hang indefinitely until manually aborted.
Environment
- Kiro Version: 0.12.333
- OS: macOS 26.5.1
- Node: v24.16.0
Steps to Reproduce
- Create a spec with multiple tasks (5+ parent tasks, 20+ sub-tasks)
- Use "Run All Tasks" which dispatches subagents via
invoke_sub_agent - The subagent runs a terminal command (e.g.,
npx vitest run <file>) - Observe: terminal output appears in the user's terminal but Kiro never advances
Expected Behavior
The terminal command completion should be detected and returned to the subagent, allowing execution to continue.
Actual Behavior
The subagent hangs indefinitely waiting for the terminal result. After ~5 minutes, user must manually abort.
Log Evidence
From `~/Libr
Environment
- Kiro Version: 0.12.333
- OS: macOS 26.5.1
- Node: v24.16.0
Steps to Reproduce
- Create a spec with multiple tasks (5+ parent tasks, 20+ sub-tasks)
- Use "Run All Tasks" which dispatches subagents via
invoke_sub_agent - The subagent runs a terminal command (e.g.,:1
🤖 Potential Duplicate Detected
This issue appears to be similar to:
- #6717: executeBash: Terminal hangs after successful command, agent receives "Signal was cancelled" (88% similar)
- #9664: IDE | Supervised mode deadlock: session freezes after accepting file changes when run_command approval is queued simultaneously (82% similar)
What happens next?
- ⏰ This issue will be automatically closed in 3 days
- 🏷️ If this is not a duplicate, you can prevent automatic closure by adding a comment or reacting with 👎 to this message.
- 💬 Comment on the original issue if you have additional information
Why is this marked as duplicate? Both issues report terminal commands hanging after successful completion in Kiro, where the agent never receives the completion signal. Issue #6717 specifically describes 'executeBash: Terminal hangs after successful command, agent receives Signal was cancelled' which matches the new issue's core symptom of terminal command completion not being propagated back to the subagent, causing indefinite hang.