Skip to content

acp_thread: Preserve tool presentation on invalid content - #64784

Draft
benbrandt wants to merge 1 commit into
benbrandt/acp-message-updatesfrom
benbrandt/acp-tool-call-patches
Draft

benbrandt wants to merge 1 commit into
benbrandt/acp-message-updatesfrom
benbrandt/acp-tool-call-patches

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Summary

Stacked on #64765, using benbrandt/acp-message-updates as the base rather than the keyed-message PR.

  • Prepare all incoming tool content before changing presentation fields or shared display entities. A missing terminal or failed content conversion no longer leaves a partially updated title, metadata, content list, or terminal command label.
  • Share preparation between creation and updates, filtering unsupported entries before positional reconciliation without constructing a disposable second set of views.
  • Preserve raw-input Markdown identity across snapshots and skip rendering unchanged input.
  • Reuse unchanged diffs without constructing discarded entities, and include the path in the reuse check so identical text at a different path does not retain the old file.

Compatibility boundary

Reported status remains authoritative even when content conversion fails. Nonterminal updates preserve an open permission request; terminal status still settles it and resumes sleep prevention as before. The existing failed-tool update/upsert lifecycle tests remain unchanged.

This makes presentation updates atomic, not the whole tool update. Existing error propagation, v1 omission semantics, raw-output fallback, and specialized native diff/terminal updates remain intact. It does not add v2 tri-state APIs, a canonical wire-state store, or protocol negotiation.

Validation

  • All 176 acp_thread tests pass.
  • Three new regressions pass across 100 scheduler seeds: failed presentation with authoritative status, display identity and changed diff paths, and creation retry/terminal-label isolation.
  • All 461 agent_ui tests pass with --test-threads=1.
  • All 41 agent_servers tests and five native replay tests pass.
  • ./script/clippy passes for acp_thread, agent_ui, agent, agent_servers, and acp_tools.
  • Formatting and diff checks pass; independent review found no blocking findings.

Suggested .rules additions

For the ACP-thread crate, proposed for a separate rules change:

Do not roll back a reported terminal tool status when output content cannot be converted. Permission settlement and sleep prevention depend on status application; validate presentation changes separately and preserve the failed-tool update/upsert lifecycle tests.

Release Notes:

  • Fixed partial tool-call display updates when content references an unavailable terminal.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Sep 25, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant