Skip to content

fix(acp): populate ToolCall title and raw_input from tool params#999

Merged
bug-ops merged 2 commits intomainfrom
fix/acp-tool-call-title-from-params
Feb 26, 2026
Merged

fix(acp): populate ToolCall title and raw_input from tool params#999
bug-ops merged 2 commits intomainfrom
fix/acp-tool-call-title-from-params

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 26, 2026

Problem

All bash tool calls in the Zed ACP chat showed only bash as the title,
making it impossible to see which command was being executed without
expanding "View Raw Input".

Root Cause

LoopbackEvent::ToolStart carried only tool_name and tool_call_id.
In loopback_event_to_updates the title was set to tool_name ("bash")
with no command information attached.

Changes

  • LoopbackEvent::ToolStart — new params: Option<serde_json::Value> field
  • send_tool_start trait method and LoopbackChannel implementation updated
  • tool_execution.rs — passes tc.input as params at the call site
  • loopback_event_to_updates — derives ToolCall.title from command /
    path / url keys in params (truncated to 120 chars with suffix);
    attaches params as raw_input for "View Raw Input"
  • permission_denied_returns_blocked_error test — uses isolated temp file
    to prevent cache pollution from bash = "allow" in the default config

Result

Zed now shows the actual command in the tool call bubble:

Run Command
gh api repos/agentclientprotocol/…/contents/docs --jq '.[] | …'

Commands longer than 120 characters are truncated with .

Test plan

  • cargo clippy --workspace -- -D warnings passes
  • All 2921 tests pass

@github-actions github-actions bot added rust core bug Something isn't working size/M labels Feb 26, 2026
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.
@bug-ops bug-ops force-pushed the fix/acp-tool-call-title-from-params branch from f7690c5 to 5a531d4 Compare February 26, 2026 20:51
@bug-ops bug-ops enabled auto-merge (squash) February 26, 2026 20:52
@bug-ops bug-ops merged commit ed152ec into main Feb 26, 2026
25 checks passed
@bug-ops bug-ops deleted the fix/acp-tool-call-title-from-params branch February 26, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core rust size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant