acp_thread: Append streamed tool-call content (#65090)

## Summary

Add a typed SDK v2 tool-content append path. `ToolCallContentChunk`
appends one complete item; `ToolCallUpdate.content` still replaces the
collection. No wire handler or protocol selection is added.

- Target exact/historical tool IDs without rebuilding the existing
snapshot. New IDs create minimal records with reported fields unset;
this is a lenient client policy.
- Reuse item preparation and registered terminal placeholders. Preserve
existing render entities, native diff ownership, tool
status/permissions/metadata/locations/raw values, and normal raw-output
fallback behavior.
- Emit updates for the actual row; only new rows use the existing
streaming-flush boundary.
- Retain item/body metadata. Delivery-scoped chunk `_meta` is not
promoted into aggregate state or stored as a separate history, matching
message chunks.

## Review guide

Production code is unchanged by the cleanup:

- [Append and fallback
refresh](https://github.com/zed-industries/zed/blob/a15b15ecc1f4feaaaf87123d9349e3d9a24d2079/crates/acp_thread/src/acp_thread.rs#L1574).
- [Shared single-item
preparation](https://github.com/zed-industries/zed/blob/a15b15ecc1f4feaaaf87123d9349e3d9a24d2079/crates/acp_thread/src/acp_thread.rs#L2949).
- [Exact-ID append and first-seen
defaults](https://github.com/zed-industries/zed/blob/a15b15ecc1f4feaaaf87123d9349e3d9a24d2079/crates/acp_thread/src/acp_thread.rs#L5332).

Coverage is now three focused regressions, reduced from seven and
approximately **1,000 → 300 test lines**:

1.
[Ordering/targeting](https://github.com/zed-industries/zed/blob/a15b15ecc1f4feaaaf87123d9349e3d9a24d2079/crates/acp_thread/src/acp_thread.rs#L13068):
historical ID, append vs replacement, clear/raw fallback, defaults,
metadata isolation, original Markdown, and row events.
2.
[Preservation](https://github.com/zed-industries/zed/blob/a15b15ecc1f4feaaaf87123d9349e3d9a24d2079/crates/acp_thread/src/acp_thread.rs#L13180):
real permission waiter, reported state, native diff identity, and
unrelated buffered text/new-row flush.
3. [UI
integration](https://github.com/zed-industries/zed/blob/a15b15ecc1f4feaaaf87123d9349e3d9a24d2079/crates/agent_ui/src/conversation_view.rs#L10077):
an existing expanded search automatically refreshes after older-tool
append, while row/entity identity and the later tool remain unchanged.

Broad content-variant, full diff-editor, and repeated render/search
matrices remain covered by existing tests rather than being repeated
here. Fixtures use SDK builders; no helper framework was added.

## Validation

- Full suites: **240 core**, **496 UI** (serial).
- Two core regressions: **100 seeds**; UI regression: **20 seeds**.
- Six-package `./script/clippy`, formatting and `git diff --check`
passed.
- Production text was verified byte-for-byte unchanged by this test-only
cleanup.

## Suggested .rules additions

GPUI testing guidance: `VisualTestContext::debug_bounds` needs a static
selector. Reuse allocated fixture selectors for runtime IDs; do not
borrow temporary `&format!(...)` strings.

Release Notes:

- N/A
23d10a4754Ben Brandt committed on 10/2/2026, 2:52:16 PM· committed by GitHubparent9dd6993
2 files changedLine totals unavailable