claude-code - 💡(How to fix) Fix [BUG] Tool-call results empty in live UI then flush late/out-of-order (Bash, Read, MCP, advisor) — macOS, Opus 4.8, parallel batches

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…

Error Message

  • No literal "Tool result missing due to internal error" in JSONL (may be UI-only per #46767).
  • Exception: server_tool_use advisor — 1 use, no tool_result in 187 lines.

Error Messages / Logs

  • UI: empty output; occasionally “Tool result missing due to internal error” (not always in JSONL).

Fix Action

Fix / Workaround

Workaround: cmd > /tmp/x 2>&1, then Read + retry; small echo to unstick queue.

Out-of-order flush: echo probes P1P4 dispatched together; results returned P1, P3, P4, P2.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet (see related: #63797, #63859, #63538)
  • This is a single bug report
  • Reproduced on 2.1.158 (claude --version, 2026-05-30)

What's Wrong?

Claude Code intermittently shows empty or missing tool output in the live session for Bash, Read, MCP tools, ToolSearch, and advisor — even though:

  1. The command ran (exit 0, files written, side effects on disk/network).
  2. The JSONL transcript eventually contains a full tool_result for most calls (after delay).
  3. Held results often flush several tool-calls later, out of order — a backlog of “empty” calls arrives in one batch after later echo probes or unrelated tools.

UI / model: empty tool panel, (No content), or once literal "start..."; model retries or fabricates when parallel batches appear empty (#63538). During bad stretches, Read of multi-KB /tmp files is empty in-session while wc -c shows the file is populated — payload delivery failure, not execution failure.

JSONL forensics (background subagent a5375c57101b89d34, session ab652a80, CC 2.1.158):

  • 88/88 tool_usetool_result paired — 0 orphan tool_use blocks.
  • No literal "Tool result missing due to internal error" in JSONL (may be UI-only per #46767).
  • Exception: server_tool_use advisor — 1 use, no tool_result in 187 lines.

Hooks: same PreToolUse stack worked before; observability curl already uses > /dev/null 2>&1 &. Not filed as broken user hook scripts — possible harness regression under parallel load (#54128 family).

What Should Happen?

Each tool delivers its full payload to the model in the turn it completes, in order, once. UI matches model input. Parallel batches return all results or fail cleanly — no silent subset or delayed stale replay.

Error Messages / Logs

  • UI: empty output; occasionally “Tool result missing due to internal error” (not always in JSONL).
  • MCP: mcp__claude_ai_jina__search_webUnauthorized (same session).
  • Disk proof despite empty tools: /tmp/gh-detail-1.txt 18123 B, gh-research-1.txt 3467 B, etc.
  • /private/tmp/claude-502 only 32K — #51814 unlikely on this host.

Session artifacts (can provide gzip on request):

  • ~/.claude/projects/-Users-Martin-Tresors-Projects-GenesisTools/ab652a80-e33f-48c7-9c5a-3f9863180455.jsonl
  • …/subagents/agent-a5375c57101b89d34.jsonl (629352 bytes, 187 lines)

Steps to Reproduce

  1. macOS 26.x, zsh, CC 2.1.154–2.1.158, claude-opus-4-8, Anthropic API.
  2. ENABLE_TOOL_SEARCH=true, experimental agent teams, CLAUDE_CODE_NO_FLICKER=1.
  3. Multiple MCP servers (some flaky).
  4. Fire 10–30 parallel Bash / Read / MCP calls (e.g. gh search / gh issue view/tmp).
  5. Observe: first N empty in UI; echo PROBE may flush backlog; Read empty while file on disk is correct.
  6. JSONL: large gap between tool_use and matching tool_result (e.g. 15 intervening tool uses for one Read).

Workaround: cmd > /tmp/x 2>&1, then Read + retry; small echo to unstick queue.

Environment

ModelOpus (claude-opus-4-8)
RegressionYes — worked before; past ~24–48h on macOS
CC version2.1.158 (also 2.1.154 at session start)
PlatformAnthropic API
OSmacOS darwin 25.3.0
TerminalClaude Code CLI
Shellzsh

Related: #63797 #63859 #63538 #46767 #51814 #39830 #42290 #38201

Additional Information

Delayed Read example: Read /tmp/gh-research-1.txt at 13:30:00Z → tool_result 18s later with 3487 B, after 15 other tool uses.

Out-of-order flush: echo probes P1P4 dispatched together; results returned P1, P3, P4, P2.

Full write-up with transcript excerpts in issue body above; happy to attach a5375c57101b89d34.output if useful.

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 [BUG] Tool-call results empty in live UI then flush late/out-of-order (Bash, Read, MCP, advisor) — macOS, Opus 4.8, parallel batches