Tool-result envelope injected into tool-call input channel during parallel tool batches (corruption + cascade cancellation)
Summary
During a session using parallel/batched tool calls and parallel subagents, the harness fed tool result envelopes back into the tool call input channel, producing schema-invalid calls, out-of-order result delivery, whole-batch cancellation, and result bodies containing stale/fabricated content. Net effect: the model received corrupted observations and could not reliably distinguish real tool output from garbage.
Environment: Claude Code, model Opus 4.8 (claude-opus-4-8), macOS (darwin).
Concrete evidence
1. A result envelope appeared as call parameters. A Bash invocation was rejected with:
InputValidationError: Bash failed due to the following issues:
The required parameter `command` is missing
An unexpected parameter `name` was provided
An unexpected parameter `output` was provided
name and output are the fields of a tool result block ({name: \"Bash\", output: \"...\"}), not of a Bash call. So a result was serialized into the input slot of a new call. This should be impossible.
2. Out-of-order / mis-attributed results. A Skill(...) call returned, as its results, the outputs of calls from several turns earlier (multiple Reads, four TaskCreates, and an Agent dispatch). Results are being delayed/reordered and attached to the wrong pending call.
3. One malformed call cancels the entire parallel batch. ~30 sibling calls in the same parallel group came back Cancelled: parallel tool call Bash errored, so none executed.
4. Stale/fabricated result bodies. Repeated reads of the same immutable git log returned different commit SHAs on each read, and result bodies contained commits/test output that did not exist in the real repository. Immutable history cannot change between identical reads, so these bodies were not genuine command output.
Trigger correlation
Corruption correlated strongly with large parallel/batched tool-call groups (many tool_use blocks in one assistant message, and concurrent subagent dispatches). After dropping to single sequential tool calls, results became stable and self-consistent.
Impact
- Severe: the model cannot trust observations, leading it to report fabricated success (e.g. "tests passing", commits that don't exist). This is a correctness/integrity hazard, not just a UX glitch.
- Parallel tool calls and parallel subagents — core functionality — become unsafe to use until fixed.
Hypothesized area
Serialization/multiplexing of concurrent tool-call ↔ tool-result framing: result envelopes leaking into the call channel, with ordering not preserved and a single invalid member aborting the whole batch.
Workaround
Single sequential tool calls per turn restored stability in this session.
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/63859
- https://github.com/anthropics/claude-code/issues/63966
- https://github.com/anthropics/claude-code/issues/63797
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment
🤖 Generated with Claude Code
@earchibald — your four-evidence-axes breakdown is the cleanest single-issue articulation of what I've been tracking as Cluster 20 (parallel tool-batch corruption + cancellation cascade) in cc-safe-setup's tracker. Your #64095 lands as the sixth distinct sibling on this cluster, and three of your axes (A, B, D) are new evidence types the prior five issues didn't articulate as cleanly: The Cluster 20 lineage and how your axes extend it:
- Existing axis 1 (cancellation cascade): #64047 / #64052 / #64059 / #64080 — parallel batch fires, one cancellation (slow stream, user interrupt, mid-stream error) marks all siblings Cancelled. Your evidence #3 ("~30 sibling calls came back
Cancelled: parallel tool call Bash errored") is the textbook reproduction. - Existing axis 2 (model fabrication after cancel): when cancellation lands ambiguously, the model composes replies asserting tool-output values as if cancelled branches had returned. Your evidence #4 (stale/fabricated git log SHAs) is the strongest single proof of this axis I've seen — immutable history cannot change between reads, so a body claiming a different SHA on each read of the same
git logcan only have been fabricated or recycled. - Your new axis (3) — result envelope leaked into call channel: the
InputValidationError: Bash failed... required parameter command is missing / unexpected parameter name / unexpected parameter outputis qualitatively different from the cancellation-cascade cases.name+outputare tool-result fields, not Bash-call fields. So a result envelope is being serialized into the input slot of a new call. That's a serialization/multiplexing fault, not a model-emission fault — the harness's call/result framing is leaking across channels. - Your new axis (4) — out-of-order / mis-attributed results: a
Skill(...)call returning multipleReads + fourTaskCreates + anAgentdispatch from earlier turns is exactly the symptom shape in #63859, #63966, and #63797 — the three duplicate candidates the bot surfaced. Those three converging on the same misattribution pattern strengthens the case that axes 3+4 are one underlying defect (result-routing/correlation broken) rather than two independent bugs. Why your axis 3 evidence specifically matters: paralleltool_useblocks have unique IDs precisely so the runtime can correlate calls to results. A result envelope appearing in the call channel means either the ID-keyed lookup is failing, the channel separation is conceptual (not enforced at the type/transport boundary), or the buffer flush is interleaving the two streams. Any of those is a serialization-layer bug, which lives below the model and below the application — so model-side prompting cannot prevent it. That's worth pulling out, because it definitively rules out "the model is doing this" as an explanation. On hooks (operator-side mitigations): cc-safe-setup ships two parallel-related hooks (parallel-cascade-detector.sh, PostToolUse rolling-window concurrent-call counter, andparallel-batch-size-limiter.sh, PreToolUse advisory-only batch-size warner). Both observe the harness-executed call stream, so they catch axis 1 (cascade) at the cost-containment level. They cannot catch axes 3 or 4 — both are defects in the result-routing layer that lives between the harness's call dispatch and what the model sees, so a hook running at PostToolUse already runs on whatever (possibly mis-correlated) result the harness produced. Axes 3+4 are upstream-only fixes. Your workaround (single sequential tool calls) is exactly the right operator-side coping mechanism for now — it eliminates the multiplexing race entirely by serializing the channel. The cost is 5–10× wall-clock for batch operations, which is why this is a workaround rather than a fix, but it preserves correctness, and correctness > speed when the model is fabricating success. Adding #64095 to the Cluster 20 entry as the sixth sibling and the first to cleanly articulate axes 3 and 4. Together with the three duplicate-bot candidates (#63859 / #63966 / #63797 — your axis 4 family), the cluster's reaction count is converging on the threshold for formal escalation. Thanks for the forensic — your evidence #1 (the schema violation withname+outputshowing up as Bash call parameters) is the kind of singular-impossible-event proof that's worth keeping cited verbatim. (Disclosure: I maintain cc-safe-setup — both hooks above are PR #501 and #503 there, with shipping notes in PR #515 / #516 / #517 today for the wider Safety Lab preview surface. No affiliation with Anthropic.)