Repository navigation
Add ACP dialect hook to normalize tool call progress events - #6769
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟢 Approval recommended
The reviewer completed the assessment and identified no concrete issues to comment on across the scoped, additive change.
No open issues 🎉
What changed in this PR
This PR adds a new optional normalizeToolCallEvent hook to the AcpDialect interface so a provider dialect can filter or rewrite the progress/output text of non-command ACP tool calls. It addresses issue #6768, where Kimi Code CLI streams cumulative tool-call argument JSON as tool_call_update content text that bb previously surfaced verbatim as subagent progress and generic result text. The existing normalizeCommandEvent hook only covered the command-output path, leaving non-command progress text unfilterable by plugins through the published SDK. The hook is applied before extractAcpToolCallOutputText in the tool_call_update progress path and in genericCloseFields, so dialects observe both in-progress and terminal updates; the command path is unchanged.
Changes:
- Add
normalizeToolCallEvent?(event)toAcpDialectand invoke it in the ACP delta translator's non-command progress and generic-close paths. - Add three tests covering suppression, rewriting, and generic-close result filtering.
- Bump the plugin SDK to 0.6.110 (both
package.jsonandplugin-sdk-version.ts) so the runtime change ships via the publish-if-missing job.
| File | Description |
|---|---|
| packages/provider-bridge-acp/src/dialect.ts | Declares the new optional normalizeToolCallEvent hook on AcpDialect. |
| packages/provider-bridge-acp/src/delta-translation.ts | Applies the hook before output-text extraction in the progress path and genericCloseFields. |
| packages/provider-bridge-acp/src/delta-translation.test.ts | Adds tests for suppression, rewrite, and generic-close filtering of the new hook. |
| packages/plugin-sdk/package.json | Bumps the published SDK version to 0.6.110. |
| packages/domain/src/plugin-sdk-version.ts | Bumps PLUGIN_SDK_VERSION to 0.6.110 to stay in sync with the manifest. |
Review effort: Balanced
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
normalizeCommandEvent and normalizeToolCallEvent now receive the call as well as the update: everything the agent has reported for the tool call so far, this update included. A dialect can tell argument echo from real output by the call's rawInput without keeping per-call state in the shared dialect object, so bb needs no extra lifecycle signals to clean that state up, and a call closed before its arguments finish no longer leaks a partial argument snapshot as its result. Co-Authored-By: Claude Opus 5.5 <[email protected]>
8913f8a to
df3596b
Compare
Human comments
What was wrong
Kimi Code CLI streams tool call arguments as cumulative JSON snapshots in ACP
tool_call_updatecontent text, before it sendsrawInput. bb rendered those snapshots as command output and subagent progress.normalizeCommandEventonly covered command output, and it saw only the update being translated, so a dialect could not tell an argument snapshot from real output (both arein_progresstext updates withoutrawInput) without keeping its own per-call state. Recorded ACP evidence: #6768.What changed
AcpDialect.normalizeToolCallEventhook, applied before progress-text extraction and generic close result extraction. Command output continues to usenormalizeCommandEvent.(event, call): the update being translated, and everything the agent has reported for that tool call so far (the translator's merged state, this update included). They are the same event when a call closes. A dialect can judge an update bycall.rawInput, so no per-call state lives in the shared dialect object and bb needs no extra lifecycle signals to clean it up. This deviates from the single-argument hook proposed in ACP: tool call argument JSON leaks into command output and subagent progress (no dialect hook for non-command progress text) #6768 and replaces the earlier forced-terminal-status and provider-error drain commits.HOST_DAEMON_PROTOCOL_VERSIONis unchanged.Compatibility: one-argument implementations (opencode, the current Kimi normalizer) still type-check and run. Code that calls a hook directly through
AcpDialectwith one argument, such as a dialect's own tests, must now pass the call too.How you verified
rawInputecho, real output) emitted{"prompt": "Compute,{"command":"echo hello-probe"}and similar asitem.progress/command.outputSnapshot.pnpm exec turbo run test typecheck lint --filter=@bb/provider-bridge-acp --filter=@get-bb/plugin-sdkpasses.Fixes #6768
🤖 Generated with Claude Code