fix(acp): populate ToolCall title and raw_input from tool params#999
Merged
fix(acp): populate ToolCall title and raw_input from tool params#999
Conversation
Each Status loopback event now emits a leading newline chunk before the status text so that consecutive calls (matching skills / building context / thinking) accumulate as separate lines rather than a single concatenated string in the ACP thought bubble. Closes #988
ToolCall.title was always set to the tool name ("bash"), making all
shell invocations indistinguishable in the Zed ACP chat UI.
Changes:
- Add `params: Option<serde_json::Value>` to `LoopbackEvent::ToolStart`
so the raw input is forwarded to the ACP layer without extra queries.
- Pass `tc.input` as params in `send_tool_start` at the call site.
- In `loopback_event_to_updates`: derive title from `command`, `path`,
or `url` key in params (truncated to 120 chars); set `raw_input` on
the ToolCall so the IDE can display it in "View Raw Input".
- Fix `permission_denied_returns_blocked_error` test to use an isolated
temp permission file, preventing pollution from a pre-existing
`bash = "allow"` entry in the default config.
f7690c5 to
5a531d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
All bash tool calls in the Zed ACP chat showed only
bashas the title,making it impossible to see which command was being executed without
expanding "View Raw Input".
Root Cause
LoopbackEvent::ToolStartcarried onlytool_nameandtool_call_id.In
loopback_event_to_updatesthe title was set totool_name("bash")with no command information attached.
Changes
LoopbackEvent::ToolStart— newparams: Option<serde_json::Value>fieldsend_tool_starttrait method andLoopbackChannelimplementation updatedtool_execution.rs— passestc.inputas params at the call siteloopback_event_to_updates— derivesToolCall.titlefromcommand/path/urlkeys in params (truncated to 120 chars with…suffix);attaches params as
raw_inputfor "View Raw Input"permission_denied_returns_blocked_errortest — uses isolated temp fileto prevent cache pollution from
bash = "allow"in the default configResult
Zed now shows the actual command in the tool call bubble:
Commands longer than 120 characters are truncated with
….Test plan
cargo clippy --workspace -- -D warningspasses