claude-code - 💡(How to fix) Fix Sub-agent returning "Tool result missing due to internal error" silently hangs parent — no error propagation [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56869Fetched 2026-05-07 03:43:15
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

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.

Error Message

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. 3. The other terminates with "Tool result missing due to internal error" (root cause unknown — possibly an MCP-or-tool-call-level failure). 4. 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). 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. 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. 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.

Root Cause

  1. In a parent agent session, launch multiple sub-agents in parallel via the Agent tool (e.g., two Explore subagents).
  2. One sub-agent returns successfully.
  3. The other terminates with "Tool result missing due to internal error" (root cause unknown — possibly an MCP-or-tool-call-level failure).
  4. 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).
RAW_BUFFERClick to expand / collapse

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 Agent tool calls in parallel (single message, two tool_use blocks) — one was an atlassian-tools:bitbucket-backed Explore subagent

Repro

  1. In a parent agent session, launch multiple sub-agents in parallel via the Agent tool (e.g., two Explore subagents).
  2. One sub-agent returns successfully.
  3. The other terminates with "Tool result missing due to internal error" (root cause unknown — possibly an MCP-or-tool-call-level failure).
  4. 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Sub-agent returning "Tool result missing due to internal error" silently hangs parent — no error propagation [1 participants]