Repository navigation
Open
Copy link
Labels
confirmed-reproBug reproduced again from a clean trusted checkout; see linked reportprovider-acpBuilt-in plugin: provider-acpprovidersCross-provider bridges, models, login
Description
Summary
claude-agent-acp tags subagent updates with _meta.claudeCode.parentToolUseId. The ACP translator ignores this tag. Subagent text and reasoning stream into the same channel as the main assistant message. Every subagent tool_call closes the main message, which splits it into fragments. Subagent tool calls show at the top level instead of under their Agent call.
Repro
Code path (found by reading main):
- Use an ACP provider backed by claude-agent-acp.
- Ask the agent to run a subagent that writes text and runs a command.
- The subagent's text appears inside the main assistant message. Each subagent tool call closes the main message and splits it. The subagent's command shows at the top level.
Cause
Line numbers are from main at 7c1353d8.
packages/provider-bridge-acp/src/delta-translation.ts:658: everyagent_message_chunkuseskey: { channel: ASSISTANT_STREAM_KEY }. The thought chunk at:676does the same.delta-translation.ts:691: everytool_callcloses the root streams withconst flush = [closeThoughtStream(), closeAssistantStream()].parentToolUseIdandparentRefdo not appear anywhere inpackages/provider-bridge-acp.- The protocol already supports nesting:
packages/provider-bridge-protocol/src/assembler/delta-assembler.ts:175useskey.parentRef, and the Claude Code bridge sets it.
Suggested fix
Read _meta.claudeCode.parentToolUseId from each update and send it as parentRef in the delta keys: text streams, item.open, item.close, item.progress and command output. Then:
- Keep a separate text stream per parent, so a subagent's text does not join or close the root stream.
- Resolve the parent once when the call opens, and reuse it for later updates of that call.
- Ignore a parent id that equals the call's own id.
- Close a parent's streams when its tool call completes, and when the turn ends or is interrupted.
const parentRef = claudeCodeParentToolUseId(update); // from update._meta.claudeCode.parentToolUseId
key: { channel: ASSISTANT_STREAM_KEY, ...(parentRef ? { parentRef } : {}) }Tested locally with a regression test.
Metadata
Metadata
Assignees
Labels
confirmed-reproBug reproduced again from a clean trusted checkout; see linked reportprovider-acpBuilt-in plugin: provider-acpprovidersCross-provider bridges, models, login
Activity
bb-slop-cop commentedon Nov 10, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotproviders,provider-acp.confirmed-repro.ACP nested output ownershipregression fails on trusted main in two clean checkouts and passes with the fix. ACP suite: 587 passed, 4 skipped; lint/typecheck pass. Recorded parity: 10 passed, 1 skipped, with a temporary empty allowlist because the default contains stale exceptions. No live external-provider/UI session is claimed.