# acp_thread: Add shared tool-call state and diff previews \(\#64875\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/986828d157135be95d999863dd1d618990173b8c)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 986828d157135be95d999863dd1d618990173b8c

Requested commit: 986828d157135be95d999863dd1d618990173b8c

Commit: 986828d157135be95d999863dd1d618990173b8c

Tree: b83a022ab2b4f7d6811321155acd6719c8c0f4ec

Author: Ben Brandt

Committer: GitHub

## Message

```
acp_thread: Add shared tool-call state and diff previews (#64875)

Review Thread:
https://delta.dev/trunk/join/thread_01m2swv74pzp4c6xk46sh19fmk#s=pVggqzly

Normalize legacy ACP tool reports and SDK v2 tool patches into one
shared `ToolCall` model, preserving protocol source separately from
local decisions and rendered views.

- Retain reported kind/status, first-class name, metadata, and complete
tool-content sources, including unknown v2 values and envelope metadata.
- Keep authorization ownership and local outcomes separate from reported
status. Support omitted/null/value patches without changing legacy
permission-continuation behavior.
- Preserve the status-before-content-validation contract: invalid
presentation cannot roll back a terminal report or leave its permission
unresolved.
- Render supported v2 patches with read-only diff editors using `diffy`.
Preserve sparse hunk coordinates, multi-file structure,
additions/deletions, and original source without reading or modifying
workspace files. Accept standalone unified patches and unambiguous bare
hunks; retain explicit fallback and export text for unsupported input.
- Keep native live diffs separate from protocol snapshots, preserve
render identity on metadata-only updates, and align patch
expansion/search with visible authorization content.

This adds the shared model and presentation boundary; it does **not**
enable v2 transport negotiation or change prompt lifecycle. Existing
v1/native adapters continue to work. The existing
one-active-authorization-per-tool policy is unchanged.

Release Notes:

- N/A
```

## Parents

- [447f72e5167eb8ccc9dbbef9d3e9c96304867599](https://git.cafe/gitcafe/zed/commit/447f72e5167eb8ccc9dbbef9d3e9c96304867599?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/986828d157135be95d999863dd1d618990173b8c?format=markdown)
