Skip to content

ACP: tool call argument JSON leaks into command output and subagent progress (no dialect hook for non-command progress text) #6768

Closed

Description

@dpolishuk

What was wrong

Kimi Code CLI (kimi acp) streams tool call arguments as cumulative JSON snapshots in ACP tool_call_update content text. bb's ACP delta translation forwards that text verbatim: as command.outputSnapshot for Bash and as item.progress for every other tool. The user therefore sees raw argument JSON ({"command":"git diff --check","cwd":...}, {"prompt":"Compute 2+2","description":...}) as command output and as subagent progress instead of the real tool output.

Root cause on bb's side: the only dialect normalization hook, normalizeCommandEvent, is applied solely to the command output path. There is no hook that lets a dialect filter or rewrite progress text of non-command tool calls, so a provider plugin cannot suppress this echo through the published SDK.

Reproduce

Environment: Kimi Code CLI 2.4.1, @get-bb/plugin-sdk 0.6.105 (bridge provider-bridge-acp), any bb thread on the kimi ACP dialect.

  1. Start a kimi ACP thread and prompt: Use the Agent tool exactly once: launch a subagent with the prompt 'Compute 2+2 and reply with just the number'. After it returns, run the Bash command + "echo hello-probe" + , then reply with exactly: done
  2. Watch the subagent item's progress and the Bash item's output.

Expected: only real tool output (2 from the subagent, hello-probe from Bash) and no raw argument JSON.

Actual: progress/output lines contain the streaming argument snapshots, e.g.:

{"prompt": "Compute
{"prompt": "Compute 2+2 and reply with just the number","description":"Compute simple arithmetic"}
{"command":"echo hello-probe"}

Evidence

Recorded raw ACP child IO (BB_PROVIDER_BRIDGE_RECORD_DIR) of the exact turn above, 2026-10-31, kimi 2.4.1: 32 argument-echo updates across one Agent and one Bash call. The sequence per call is always:

  1. tool_call open (pending, empty content).
  2. N × tool_call_update in_progress with cumulative argument-JSON content text and no rawInput.
  3. tool_call_update in_progress with rawInput and content text exactly JSON.stringify(rawInput).
  4. Real output only afterwards (completed with rawOutput, or later in_progress output).

A committed replay fixture with the same Agent echo is at https://github.com/dpolishuk/bb-kimi-code/blob/c9fba16f5107d9dc6f523210de06ca6aaf469854/recordings/agent-delegation.ndjson (lines 35+ show item.progress messages that are pure argument JSON).

What I ruled out

  • Fixing it inside the provider plugin with the current SDK: AcpDialect only offers toolIdentity, classifyToolCall, commandResult, normalizeCommandEvent, handleClientRequest, presentModel. None is invoked for non-command progress text (extractAcpToolCallOutputText is called on the raw event), so the echo is unfilterable for Agent/Read/Grep/etc.
  • Suppressing all JSON-looking text: real command output can itself be JSON (e.g. br list --json printing {"issues":[...]}), so filtering must be phase-aware (arguments before rawInput, real output after), which requires a dialect hook on the progress path.

Proposed fix

Add normalizeToolCallEvent?(event): AcpToolCallUpdateEvent to AcpDialect, applied before extractAcpToolCallOutputText in the tool_call_update progress path and in genericCloseFields (so the hook also observes terminal updates for per-call state cleanup). PR follows with tests and a live-verified kimi dialect implementation.

AGENT GENERATED

Activity

  1. added theissue type on Oct 31, 2026
  2. added
    providers
    provider-acp
    confirmed-repro
    on Oct 31, 2026
  3. bb-slop-cop commented on Oct 31, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification applied: Bug · Priority: Medium · Effort: Medium; labels: providers, provider-acp, confirmed-repro. No existing classification values were replaced.
    • Reproduction and root-cause report: REPRODUCED · high root-cause confidence. The authored translator replay produces the same three expected failures and one passing command-filter control in two clean checkouts of 916d684ac23d. Live Kimi behavior was not tested.
    • Root cause: ACP content text becomes output; command-only dialect normalization cannot filter non-command progress or generic terminal output. The positive control preserves legitimate JSON output.
    • No new fix PR: PR #6769 already links to this issue; a duplicate would be unsafe. Its diff received static review only.

    AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproprovider-acpproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions