Sub-agent returning "Tool result missing due to internal error" silently hangs parent — no error propagation
Summary
When a sub-agent launched via the Agent tool terminates with an internal error and returns the result Tool result missing due to internal error, the parent agent does not receive an error signal. It continues as if it's still waiting on the sub-agent, leading to an apparent infinite hang from the user's perspective.
Environment
- Claude Code CLI (latest as of 2026-05-06)
- Windows 11, Git Bash
- Model: Opus 4.7 (1M context)
- Parent launched two
Agenttool calls in parallel (single message, two tool_use blocks) — one was anatlassian-tools:bitbucket-backed Explore subagent
Repro
- In a parent agent session, launch multiple sub-agents in parallel via the
Agenttool (e.g., two Explore subagents). - One sub-agent returns successfully.
- The other terminates with "Tool result missing due to internal error" (root cause unknown — possibly an MCP-or-tool-call-level failure).
- Parent agent's tool_result for the failed call shows the error string, but no error is surfaced as a tool-level failure — the parent does not treat this as terminal and appears to continue waiting (observed as a UI hang from the human user's perspective until they interrupt).
Expected
A sub-agent returning an internal error should propagate as a tool-level error to the parent, not a silent partial result. The parent should be able to observe the failure, decide how to recover (retry, give up, proceed with partial data), and move on.
Actual
The parent agent has no signal that the sub-agent has actually finished with an error. There's no timeout, no retry path, and no visible exception. From the user's side, it looks like Claude Code has hung.
Suggested fix
Raise an InternalError tool response for the specific tool_use_id when the Agent tool's sub-agent exits without a normal result. This lets parent agents catch it and recover, the same way they handle any other tool error.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗