Updates `agent-client-protocol` to 5.3.0 (schema 1.18.0) and brings what
Zed already implements in line with the rules that changed.
- **Plan operations: the `file` plan type is removed.** Markdown plans
carry an optional absolute `path` instead, and the client always renders
`content`. A markdown plan with a `path` keeps the collapsible plan row
and gets an "Open Plan File" button. A relative `path` is ignored, so
the plan has no file. Naming or changing the file counts as a change to
the plan, so it re-shows a dismissed plan, as a new URI did for file
plans.
- **Unknown v2 command types are no longer offered as slash commands.**
The spec used to let a client show a command type it doesn't understand
as a plain command. It now says the client must not. The composer only
offers `command` entries for completion, input hints, validation, and
the "/ for commands" placeholder. `AcpThread` still keeps the full list.
This also covers the new `skill` entries, which Zed doesn't advertise
support for.
- **The new `speed` config option category converts from v1.** The
`unstable` SDK feature now parses `speed` as a known category. The v1
conversion rejected categories it didn't list, so one `speed` option
would have failed the agent's whole option list.
Checked against the 1.18 docs, no change needed:
- `replay_complete` (v2) is ignored. Zed still treats the
`session/resume` response as the end of replay and discards the thread
when a resume fails, and the RFD keeps the subagent freshness boundary
at the response.
- The subagent clarifications already hold. An `unknown` state shows as
unconfirmed, and a session message without a sender renders as a message
from another session.
- Zed doesn't send `tool_call/cancel` or `terminal/cancel` once the tool
call is final or the terminal has exited.
- Zed doesn't call `session/options` or `session/fork`, so the new rules
for them don't apply.
Not adopted yet: prompt suggestions, Agent Skills, placing `speed`
options next to the model selector, and using `replay_complete` to show
replayed history before the resume response.
Release Notes:
- N/A
Updates `agent-client-protocol` to 5.2.0 (schema 1.17.0) and adopts its
new additions.
- **Session references in tool call content.**
`ToolCallContent::Session` (unstable subagents) used to render as
"Unsupported tool call content." for v2 agents and was dropped for v1
agents. It now renders as an "Open Session" link that switches to the
referenced session, labelled the same way as session-message
participants. Because references are display-only, sessions Zed doesn't
know about show as "Unavailable Session" and aren't loaded.
- **Saved config defaults sent inline with `session/new`, behind the ACP
beta flag.** If the agent advertises `sessionCapabilities.options`, Zed
now sends the user's saved config defaults in the session-creation
request (`configOptions`) instead of only applying them one
`session/set_config_option` call at a time afterwards. This covers v1
and v2. `session/options` is still a draft, so this only happens with
`acp-beta` enabled. The existing one-at-a-time pass still runs after
creation: it sends nothing when the agent already applied everything,
and it still catches defaults the agent skipped (for example, one that
depends on another option's value).
- The `session/options` request itself is not used yet.
- `AuthAccount.description` is not adopted, because Zed doesn't use auth
status.
Release Notes:
- N/A
Implements client support for the [plan operations
RFD](https://agentclientprotocol.com/rfds/plan-operations).
- Plans keyed by `planId` can now hold structured items, markdown, or a
file URI, and a plan can switch between these types.
- `plan_removed` drops the plan. If it was the visible plan, the
activity bar falls back to the most recently changed non-empty plan. If
the user dismissed the plan panel, removal doesn't reopen it.
- v2: `plan_update` with `markdown` and `file` content and
`plan_removed` are now applied instead of falling through as unhandled.
- v1: `plan_update` and `plan_removed` are applied instead of being
dropped. Zed advertises the `plan` client capability only behind the
`acp-beta` flag, the same as subagents. v2 connections are already
beta-only.
- UI: markdown plans use the existing collapsible plan row. Collapsed,
the row shows the first heading. Expanded, the markdown renders in a
scrollable area. File plans show the file name, and clicking the row
opens the file.
Not included: a switcher for multiple concurrent plans. The activity bar
still shows only the most recently changed plan.
Release Notes:
- N/A
Implements the background work additions to the ACP v2 spec
([RFD](https://agentclientprotocol.com/rfds/v2/background-work)).
- **`paused` tool calls:** `paused` is now its own `ToolCallStatus`. The
tool call card shows a pause icon with no spinner. Before this, `paused`
displayed as in progress.
- **Background list:** `AcpThread::background_work()` returns the
`background` list from the agent's latest state update. If the update
leaves it out, background work is unknown rather than empty. While the
session is idle and the agent reports background work, the label next to
the message editor shows "N tasks in background".
- **Stopping one tool call:** while a tool call advertises
`capabilities.cancel` and hasn't finished, its card has a Stop button
that sends `tool_call/cancel`. `AcpThread::cancel_tool_call` refuses
locally otherwise, because Clients must not send it unadvertised.
- **Stopping an agent-run terminal:** the terminal card's Stop button
also appears for agent-run terminals that advertise cancel and haven't
exited. It sends `terminal/cancel`, and its tooltip says the output
stays available.
Release Notes:
- N/A
Implements the `cwd` and `additionalDirectories` fields that the
[subagents RFD](https://agentclientprotocol.com/rfds/subagents) adds to
`subagent_update`. Zed previously dropped them.
- `SubagentAssociation` stores both fields as nullable patches: omitted
leaves a field unchanged, `null` clears it, and a value replaces it.
- A field the parent hasn't reported is inherited from the parent's own
working directories, and the two fields inherit independently. Each ACP
subagent's effective directories become its `work_dirs`. When a parent's
directories change, nested subagents are updated too. Native subagents
are unchanged.
- v1 updates now carry both fields. A relative path is ignored with a
warning, the same way v2 ignores a malformed field.
- In v1, a subagent's `terminal/create` without a `cwd` runs in the
subagent's effective `cwd`, as the RFD requires. Root sessions are
unchanged.
Release Notes:
- N/A
Upgrades `agent-client-protocol` from 3.6.0 (schema 1.13.0) to 5.0.0
(schema 1.15.1), and brings Zed's v1 and v2 ACP clients in line with the
spec and schema changes made since then.
## SDK 5 port
- Schema types move from `schema::v1`/`schema::v2` to
`v1::schema`/`v2::schema`, builders to `Client.v1()`, and v2 handle
types to `agent_client_protocol::v2`.
- `agent_client_protocol::Error` is now the SDK's own type, not the v1
schema error. Zed uses it at the SDK boundary, and `ProtocolErrorInfo`
also recognizes it so auth-required detection keeps working.
- Foreground dispatch helpers are generic over the protocol marker, and
v2 request IDs come straight from the handles.
- SDK 5 only matches transport-closed errors that the SDK itself
produced, so peers can't forge them. A test that built one by hand now
covers only the local disconnect case. The `agent_servers` tests still
cover real transport loss.
## Spec changes
- `session/close` and `session/delete`: a `-32002` response counts as
success, on both v1 and v2.
- Permission and elicitation requests that name an unknown session get
`-32002` with `data.sessionId` instead of `-32603`. The v2 migration
guide makes this required for Clients too.
- v2 `usage_update.cost` is a patch field: omitted leaves it unchanged,
`null` clears it. A v1 update without a cost still leaves it unchanged.
- A `plan_update` whose type Zed can't render (`file`, `markdown`, or an
unknown type) still replaces the plan with that `planId`, so the old
entries stop showing.
- A diff `patch` with an unrecognized `format` renders from `changes`,
as if `patch` were omitted.
- v2 never sends an empty prompt.
- On v2, `session/cancel` no longer answers pending permission requests
locally. They stay open until the agent cancels them with
`$/cancel_request`, because requests for background work survive a
cancel. v1, including v1 subagents, keeps answering them with
`cancelled`.
## Follow-ups
These are left for separate PRs:
- Background-work UI: the `paused` status, the `background` list, and
cancel buttons for tool calls and terminals. Until then, `paused`
displays as in progress, which the spec allows.
- Subagent `cwd` and `additionalDirectories`.
- The new unstable methods: `auth/status`, `session/set_title`,
`session/status`, `session/archive`.
Release Notes:
- Improved compatibility with the latest Agent Client Protocol,
including handling of missing sessions, plan updates, diff formats, and
cancellation of permission requests.
Updates `agent-client-protocol` to 3.6.0 (schema 1.13) and adopts the
protocol clarifications made since schema 1.12. Each commit stands
alone:
1. **Update agent-client-protocol to 3.6.0 (schema 1.13)**
- Adapts to the new types: tagged `AvailableCommand`,
`CancelledPermissionOutcome`, `ClientAuthCapabilities`, 1-based
`NonZeroU32` tool call lines, signed terminal exit codes, unsigned
`ResourceLink.size`, and v2 `RequestId` (no `null`).
- Terminal exit codes keep the platform's signed value instead of `c as
u32`; v1 Agents still receive the same 32-bit pattern as before.
- Session message participants follow the new patch rules: omitted
keeps, `null` clears, a value replaces.
- An unknown tool status shows as in progress.
- Unknown command kinds are offered as plain commands.
- v1 `terminal/*` calls for an unknown terminal return `-32002`.
- A `terminal_update` with an invalid `output` snapshot still applies
its other fields (agentclientprotocol/agent-client-protocol#2577).
2. **Reject elicitation forms Zed can't render**: `-32602` for a
required property of an unknown type, a dangling `required` name, or
`enum` with `oneOf`. Optional unknown properties are left out, and
defaults that don't match their schema are ignored.
3. **Show streamed tool text as continuous text**: adjacent plain text
in `tool_call_content_chunk` extends the previous text block, like
message chunks.
4. **Apply tool call permission subjects to the transcript**: a
`tool_call` subject is applied like a `tool_call_update` before the
prompt is shown, so the permission card attaches to its tool call.
Related SDK and spec PRs: agentclientprotocol/rust-sdk#450,
agentclientprotocol/rust-sdk#451,
agentclientprotocol/agent-client-protocol#2578.
Release Notes:
- N/A
With the `acp-beta` flag on, Zed's ACP v1 `initialize` request
advertises the unstable
[subagents](https://agentclientprotocol.com/rfds/subagents) capability
(`clientCapabilities.subagents: {}`). v1 agents that support it, such as
claude-agent-acp, then report their subagents as child sessions, which
Zed shows as inline cards. Without the flag nothing changes. v2 is
already behind the same flag and has subagents in its baseline.
Release Notes:
- N/A
A tool call carrying Zed's private `_meta.subagent_session_info` makes
the conversation `load_session` the referenced session. That's how Zed
restores native subagents. Some external agents send the same key,
according to #65120, so that path stays for them.
Where the ACP subagents RFD applies, though, subagents are discovered
only through their parent's announcements, and loading one is forbidden.
Loading a referenced child before its announcement would also make the
connection reject the announcement, because the connection already
routes that session.
- `AgentConnection::announces_subagents` says whether the RFD applies:
always on v2, on v1 when Zed advertised `subagents` (behind `acp-beta`),
and never for the native agent.
- `ConversationView::load_subagent_session` does nothing where it
applies.
Without `acp-beta` nothing changes, because no connection announces
subagents.
`test_referenced_subagents_load_only_without_the_subagents_rfd` checks
both cases with a stub connection that supports loading, and fails
without the guard. Existing v1 and v2 tests now assert each connection's
answer. `cargo nextest run -p acp_thread -p agent_servers -p agent_ui -p
agent -p sidebar` (2010 tests), `./script/clippy` and `cargo fmt` pass
locally.
Release Notes:
- N/A
After a load or resume with replay, #66061 cleared each subagent's
replayed `cancel` grant and running state but kept a replayed idle
outcome (completed, canceled, failed). That exception was there because
claude-agent-acp sent no current state after the response.
claude-agent-acp now sends each replayed subagent's current state after
the response (agentclientprotocol/claude-agent-acp#1423, merged), as the
subagents RFD requires. So Zed now follows the RFD as written: every
replayed work state, outcomes included, is history. Each subagent's
state is unconfirmed until the agent reports a current one. Titles and
transcripts stay.
Release Notes:
- N/A
An ACP v2 agent can send updates before its `session/new` response; Zed
holds them until the response names the session
(`PendingSessionUpdates`). Only the new session's own updates were
handed over. A subagent it announced in that window was created, but the
subagent's own traffic was discarded when the creation ended.
- `PendingSessionUpdates::take` now also hands over traffic for sessions
the new session announced, and for the sessions those announced, in
arrival order. The subagents RFD requires a child's announcement to come
before its traffic.
- The `new_session` apply loop delivers each held update to its own
session's thread. It used to apply all of them to the new session.
Traffic for a session nobody announced is still dropped. v1 has no
pre-response staging and is unchanged.
`v2_new_session_keeps_subagent_traffic_sent_before_its_response` sends a
child, a nested grandchild announced on the child's stream, traffic for
both, and traffic for an unannounced session, all before the response.
It fails without the change. `cargo nextest run -p acp_thread -p
agent_servers -p agent_ui -p agent -p sidebar` (2010 tests),
`./script/clippy` and `cargo fmt` pass locally.
Release Notes:
- N/A
Fixes the `main` failure in `v2_subagent_config_options_are_read_only`
(Linux, macOS and Windows `run_tests` since #66058).
#66059 and #66058 passed CI separately, but together they disagree.
`AcpV2Connection::session_config_options` returned `None` for a subagent
before reaching #66058's read-only provider. So that provider was never
used: subagents showed no configuration, and the #66058 test failed.
- Subagents now get `ReadOnlyConfigOptions`, which refuses
`set_config_option`. That's what #66059's early return was there to
guarantee.
- The provider is chosen with the same `is_subagent` check that close
and reopen use, instead of a second rule reading the thread's
`parent_session_id`.
- #66059's test now expects a read-only provider instead of none.
`cargo nextest run -p acp_thread -p agent_servers -p agent_ui -p agent
-p sidebar` (2009 tests, including both subagent config tests),
`./script/clippy` and `cargo fmt` pass locally.
Release Notes:
- N/A
Show the actual configuration reported by exposed ACP subagents without
offering controls their sessions do not support.
- Register an empty config provider when a child is announced, so the
first asynchronous snapshot reaches the UI in both ACP versions.
- Expose a read-only provider that rejects configuration mutations
before sending a wire request.
- Render child settings as labels below the transcript, including
boolean values, while leaving the message composer unavailable.
- Block picker/cycling actions and stale controls from changing child
settings or saving defaults.
- Test snapshot replacement, watcher updates, parent isolation, and
read-only behavior.
Protocol clarification:
https://github.com/agentclientprotocol/agent-client-protocol/pull/2468
Claude adapter implementation:
https://github.com/agentclientprotocol/claude-agent-acp/pull/1417
Release Notes:
- N/A
The v2 connection already refused to close a subagent. It now also:
- **Offers no config options for a subagent.** A `config_option_update`
for a subagent session used to create config options on its
`AcpSession`, and `session_config_options` then handed them out. Nothing
reached the wire: subagent views have no message editor, where the
selectors are drawn, and setting an option through the config keyboard
actions failed validation because subagents have no `session_owners`
entry. This makes the refusal explicit instead of relying on that.
- **Refuses load and resume for a subagent it routes.** `open_session`
only checked root sessions, so it would have sent `session/resume` for a
known subagent.
`AcpSession` gains `is_subagent`, set only when a parent announces the
session. All three checks (close, config, open) read it through one
helper. The previous close check read the thread's association instead,
but `open_session` can run while the session's thread is being updated
(`v2_resume_sdk_shares_compatible_opens_and_rejects_context_or_history_changes`
reopens from inside the thread's update), and reading the thread there
panics.
Release Notes:
- N/A
ACP v1 awaited `session/load` and `session/resume` responses with
`block_task`, so the SDK kept delivering the agent's later messages
before Zed had applied the response. A subagent's current state sent
right after a load response could be applied first and then overwritten
by the response.
- **Ordered responses:** load and resume now use `ordered_response`.
Once the response arrives, the agent's later messages wait until
`open_or_create_session` has applied it, as v1 `new_session` and v2
already do. An abandoned load releases them before closing its session,
which needs the agent's reply.
- **Replay boundary:** a successful v1 load, which replays history, ends
with `invalidate_replayed_subagent_state`, as a v2 resume with replay
does. v1 resume doesn't replay, so it's unchanged.
Release Notes:
- N/A
When a load or resume replays history, its successful response is the
freshness boundary for subagents. Work state and `cancel` grants
reported during the replay are history: they may stay visible, but must
not confirm current activity or allow cancelling until the agent reports
them again after the response. Before this change, a replayed
`subagent_update` with `capabilities.cancel` and a replayed
`state_update: running` for the subagent left Zed showing it as running
and cancellable.
- **Boundary:** when a v2 resume with `replayFrom: start` succeeds,
`AcpThread::invalidate_replayed_subagent_state` clears every subagent's
`cancel` grant, recursively for nested subagents. A replayed running or
requires-action state becomes unconfirmed; a replayed outcome
(completed, canceled, failed) stays, since it confirms no activity.
claude-agent-acp replays each subagent's outcome and sends nothing after
the response. Titles, descriptions and transcripts stay.
- **Ordering:** the call sits in the ordered response handler, next to
the existing check that the agent reported the parent's current state.
That handler applies after the replay and before any update sent after
the response, so fresh snapshots are kept.
- **Resume without replay is unchanged:** the RFD treats updates sent
before its response as current.
Release Notes:
- N/A
The RFD reports messages between sessions, such as a parent delegating
work to its subagent, as `session_message` and `session_message_chunk`
updates. Each transcript gets its own view: the parent's outgoing
message, the subagent's incoming one. Zed dropped both.
- **Transcript entry.** Session messages are a new
`AgentThreadEntry::SessionMessage`, kept separate from user and
assistant messages. They reuse the keyed-message path: an upsert
replaces content, a chunk appends, and a message can start with a chunk.
Participants come only from `session_message` upserts: one that an
upsert omits keeps its earlier value, and a known participant cannot
change. Chunks carry only content, so the participant fields that schema
1.12.0 still has on chunks are ignored, following the RFD revision in
agentclientprotocol/agent-client-protocol#2465. v1 replaces message
metadata where v2 patches it by key.
- **Row.** It reads "To <recipient>" or "From <sender>". A subagent is
named with its parent's title for it, as on its permission card, and the
root session as "Main Agent". The name opens that session's thread; a
session the conversation never learned about shows as "Unavailable
Session" without a link.
- **v1 stays off.** Like `subagent_update`, v1 session messages are only
applied when Zed advertised the `subagents` client capability, which it
does not do yet.
- **Resume replay test.** A separate commit adds
`v2_resume_replay_delivers_subagent_history`. It confirms that a
subagent's history replayed during a v2 resume reaches the subagent.
#65976's description said this wasn't handled; resume registers the
parent before sending `session/resume`, so it works.
Follow-up: the same RFD revision adds optional `senderMessageId` and
`recipientMessageId` so each view can name the other. Once a schema
release includes them, the row will jump to the linked entry instead of
opening the thread, and per-delegation subagent cards can build on the
same links.
Release Notes:
- N/A
Updates `agent-client-protocol` to
[v3.5.0](https://github.com/agentclientprotocol/rust-sdk/releases/tag/v3.5.0)
and adopts its fixes for v2 integration feedback.
- **Typed v1 fallback:** v2 startup uses `send_initialize`. A
`LowerVersion` outcome or a v1-only `-32022` error triggers the v1
fallback directly, instead of recovering the agent's response from the
debug log. The debug-log lookup is now only used when the agent exits
right after answering and the process-exit error supersedes the in-band
result.
- **Termination-aware disconnects:** connection-loss checks now include
`termination()` and `is_connection_terminated`, so transport or handler
failures (not only clean EOF) are treated as a lost connection.
Disconnect cleanup still uses `on_close` plus driver completion:
`finish_connection` already runs once the driver ends, and `on_close`
stays the ordered barrier for clean EOF.
Release Notes:
- N/A
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
ACP agents announce subagent sessions with `subagent_update` on the
parent's stream. Zed dropped these: v2 left them unhandled and v1
ignored them. On v2, where subagent support is part of the baseline and
only negotiated with `acp-beta`, a subagent's updates were discarded and
its permission requests failed with "unknown session".
- **Routing.** The first `subagent_update` for a session creates an
agent-owned child `AcpThread` (no prompting, no working directories,
action log linked to the parent's, as native subagents do), registers it
for routing on the connection, and hands it to the parent's subagent
registry. The child's own updates, permission, elicitation, fs and
terminal requests then reach it. One helper, `apply_subagent_update`,
serves v1 and v2.
- **Association.** Title, description and cancel capability are stored
on the child (`acp_thread::subagents::SubagentAssociation`) with the
RFD's patch semantics: omitted is unchanged, `null` clears, capabilities
are replaced whole. A session ID the parent does not already own is
rejected if the connection routes it, so an update cannot reparent a
session, refer to the parent itself, or form a cycle.
- **Activity.** On v2 the subagent's own `state_update` drives its
activity and the parent's mirrored copy is ignored. On v1 the
association's state snapshot is the only source, and `null` leaves
activity unconfirmed.
- **v1 stays off.** v1 applies `subagent_update` only if Zed advertised
the `subagents` client capability, decided from the same
`client_capabilities_for_agent` value it sends. Zed does not advertise
it yet (a test guards that), so v1 behavior is unchanged; a later PR
offers it behind `acp-beta`.
- **No closing subagents.** Releasing a child never sends
`session/close`, and v2's `close_session` refuses ACP subagents; the
agent releases them with their parent.
- **UI.** A subagent's permission card in the parent labels it with the
parent's title for it, then its own title. Inline subagent cards and
navigation into subagent threads come in a later PR, so today the
visible change on v2 is that subagent permission requests appear in the
parent and can be answered.
Release Notes:
- N/A
Add capability-gated ACP v2 `session/delete` support through the
existing session-history interface.
- Derive `supports_delete()` from the agent's advertised
`session.delete` capability. Missing or null capability rejects deletion
locally without publishing an RPC.
- Send the exact opaque session ID using the existing request-scoped
transport helper, preserving structured server errors and request
cancellation behavior.
- Keep deletion separate from closing active sessions: do not implicitly
send `session/close` or `session/cancel`, remove client session owners,
retry failures, or synthesize a bulk-delete operation. Active-session
deletion behavior remains agent-defined, as specified by ACP.
Release Notes:
- N/A
- Select ACP v2 for new connections when the existing `acp-beta` feature
flag is enabled; leave flag-off connections on v1 and preserve v1 beta
behavior on fallback.
- Start a fresh v1 process/transport only after a correlated
initialization exchange establishes v1-only support: a valid v1
initialization response or structured `-32022` data with `requested: 2`
and a well-formed `supported` list containing 1 but not 2. Do not guess
from error-message text or retry malformed initialization, unrelated
protocol errors, or ordinary transport failures.
- Drain initialization output on natural process exit before classifying
failure, preserving structured negotiation diagnostics even when the
agent exits immediately after rejection.
- Include v2 connections in the existing ACP logs UI without adding
debug-log requirements to the generic connection trait.
This is behavior-changing activation for the existing `acp-beta`
audience.
Release Notes:
- N/A
Give ACP v2 runtime/process resources an explicit, idempotent shutdown
boundary independent of retained session models.
- Shut down v2 connections when their shared `AgentConnectionStore` is
released or the app quits. Weak ownership tracking includes replaced
connections still retained by old views or pending receipts without
pinning them.
- Cancel pending connection startup when its owner ends and shut down a
connection that succeeds after its owner has gone away. A weak
resource-level v2 app-quit hook is installed before initialization
completes, so process termination does not depend on foreground startup
cancellation being polled during quit.
- Keep startup resources alive through startup error arbitration. A
protocol rejection must not be replaced by the SIGKILL caused by our own
cleanup. Explicit owner/app shutdown can still take the resources
immediately; the existing priority for natural process exit remains
unchanged.
- Close the shared foreground dispatcher after I/O/disconnect cleanup
finishes, even when retained API handles still own senders.
- Preserve receipt evidence and single-view release policy. No
`session/close` RPC, automatic resend, or process termination merely
because one view is released.
## Shutdown contract and scope
- This is a **hard stop** using the existing owned-child mechanism, not
a graceful agent shutdown or a new grace period. Agent-side
work/persistence can be interrupted when the shared owner ends.
- Quit callbacks synchronously initiate process termination and
cooperative runtime cleanup, then return. They **do not wait for process
reaping, final receipts or a full foreground/protocol drain before
`App::shutdown()` returns**. Tests that await those outcomes afterward
do not establish a before-return drain guarantee.
- The explicit resource-shutdown hook is implemented for v2. Completed
v1/native connections retain their existing default release behavior.
- **Pending-connect cancellation applies to all agent types**, and
dispatcher cleanup is shared with v1. These are intentional broader
changes, not v2-only plumbing.
Release Notes:
- N/A
Apply saved `default_config_options` only when creating **new ACP
sessions, in both v1 and v2**. Loading/resuming preserves the agent's
returned configuration. Legacy `default_mode` handling is unchanged;
production v2 selection remains disabled.
- **V1:** remove automatic config-default application from the shared
load/resume path. Keep new-session default application and legacy modes
unchanged. This intentionally changes current production behavior:
reopening a conversation no longer overrides its config with global
defaults.
- **V2:** read current settings during new-session startup and use the
existing config provider/offered-value validation. Skip absent,
unsupported, mismatched, unavailable and already-set defaults.
- Settle the ordered creation acknowledgement before config RPCs and
finish defaults before delivering the new v2 session. Re-read each
authoritative response for dependent options, with at most one attempt
per option so normalization/conflicting defaults cannot oscillate.
- A rejected v2 preference keeps the session usable with a visible
notice. Transport/callback loss fails startup; abandoning startup cleans
up the undelivered session and safely handles late replies.
Release Notes:
- Improved ACP configuration defaults to apply only to new
conversations, preserving session settings when reopening existing
conversations.
- Preserve supported v2 `session/update` notifications received before
`session/new` reveals the session ID. Register a creation's admission
window before publication, stage only unbound notifications, and use the
successful response's session ID to claim its eligible prefix.
- Drain preceding foreground work before binding/replay. Replay state,
content, tools, decoded terminal output and metadata in receive order,
then apply the response's authoritative config and commands. New-session
default Idle never overwrites a reported state.
- Bound staging per connection to **1,024 notifications and 16 MiB of
encoded payload**. Count encoded bytes without allocating another
payload copy. Overflow fails affected creations visibly rather than
publishing partial history; registered owners continue receiving live
updates normally.
- Clean up provisional entries on rejection, observer drop, abandoned
success and EOF. Admission generations prevent later creations from
adopting an older prefix. Route abandoned-session cleanup through the
foreground owner check so an abandoned duplicate response cannot close
an existing owner.
- Preserve v1/native behavior. Legacy contexts do not enable staging,
and the public terminal-only ingress path does not incur payload
measurement. Production still selects v1; v2 remains unselectable.
Release Notes:
- N/A
- Implement typed v2 `session/close` against the existing owner
registry. Session capability support now enables explicit close;
automatic view release remains detach-only.
- Share one in-flight close per owner. Mark closing synchronously,
reject new prompt/config publication and reopen while closing, and fence
both success and error cleanup by the captured entity ID.
- Reject close during unfinished initialization without cancelling
initialization or sending a close RPC. Preserve typed close rejections,
including their data, and allow an explicit retry. Dropping a close
observer does not cancel the operation or release its routing fence
prematurely.
- Commit successful-close effects and owner retirement after the ordered
foreground barrier, before exposing Stop or close completion. Successful
close can finish waiting Stop observers without inventing an Idle
snapshot, including for unconfirmed activity. Close does not disconnect
receipt observation.
- Keep the original model alive for the pending receipt IDs captured by
that close attempt, independently of view/close-observer lifetime. A
rejected close cannot extend this retention to later submissions. Close
success and a subsequent reopen do not discard late acceptance or
pre-insertion cancellation, mutate a replacement, or hang
accepted-but-un-echoed receipts. Retired projections release on
settlement or transport loss.
Release Notes:
- N/A
- Make usage events carry their counter semantics: context-only refresh,
generation-tagged legacy/native additive presentation, or absolute
foreground-generation snapshot. Replace/correct v2 totals instead of
adding the latest model value for every queued callback; preserve
legacy/native additive presentation.
- Keep resume successful when a peer omits its required pre-response
state snapshot. Preserve the binding, replay, config and commands; log a
warning and represent activity locally as `Unconfirmed` rather than
defaulting to Idle or forcing a retry.
- Show a neutral unconfirmed-activity status in the composer and
sidebar. Manual sends remain available; automatic queue draining,
stop-and-send and archival cannot treat missing state as evidence that
work stopped.
- Adopt subsequent state reports normally. Initial Idle confirmation can
release waiting stops and queued messages without inventing a foreground
completion, clock, notification or cancellation of current URL
interactions. Observation loss fails a waiting stop rather than
confirming it.
Release Notes:
- N/A
- Delegate v2 entity `_meta` patches to the SDK helper for
user/agent/thought messages, tool calls and permission subjects,
terminal display state, session info, and compaction.
- Preserve omitted keys, remove keys set to null, replace nested values
whole, retain nested null data, and honor whole-field null clears. Empty
objects and removals of absent keys have no effective-change signal.
Explicit clears also clear derived tool hints.
- Keep wire provenance through session-info updates and the list
notification lane rather than erasing it in a v1-to-v2 conversion. V1
session-info omission/null behavior and full metadata replacement remain
unchanged; v1 compaction retains its own omitted/null/replacement rules.
- Preserve snapshot metadata literally. In particular, v2 list entries
no longer route their metadata through an upsert; null-valued keys
remain data. Content/chunk, terminal output/exit snapshot, and plan
metadata stay separate from entity metadata.
Release Notes:
- N/A
- Separate explicit close support from UI teardown policy through a
default-compatible `AgentConnection::should_close_sessions_on_release`
method. Both view destruction and server-state replacement respect it.
- Make v2 explicitly opt out of automatic close: closing a session
cancels agent-owned work, while disposing its view must not. Explicit v2
close support remains disabled.
- Return all batch-close failures with session IDs and original error
objects, preserving SDK codes/data. Wait for every result rather than
abandoning other closes after the first failure; automatic teardown logs
the aggregate error instead of discarding results.
Release Notes:
- N/A
- Add inactive v2 application load/resume support. Load sends
`session/resume` with `replayFrom: {type: "start"}`; ordinary resume
omits replay. Capability exposure follows negotiated session support.
- Register one real receipt-mode thread before publication so replay,
session info and reported activity received before the reply have a
destination. Apply initial config/commands at the response's application
barrier; RPC completion does not synthesize Idle.
- Share compatible concurrent opens and reuse compatible live owners.
Reject project/setup changes and attempts to load full history into a
live owner opened without replay, rather than silently retargeting or
replaying into existing history.
- Keep initialization session-owned using weak owner/connection
references. Last-observer release cooperatively cancels only the resume
RPC and its request-scoped input, while retaining its SDK response and
routing reservation until the peer replies and preceding foreground
replay settles. A replacement cannot receive late abandoned replay.
- Reuse normalized directory/MCP setup and initial-state application
between creation and reopening. Preserve SDK error identity/data and
auth-required detection for every observer of a shared failure. Owner
cleanup is entity-ID checked and does not retain abandoned views or the
connection.
Release Notes:
- N/A
- Expose stateless, snapshot-only v2 `session/list` through the existing
`AgentSessionList` history/import interface when the peer advertises
session support.
- Preserve directory filters, opaque cursors, request/page/entry
metadata, titles and timestamps. Reuse the byte-identical
ordered/deduplicated directory helper and the existing session-info
projection rule. Do not invent creation timestamps.
- Keep scoped RPC publication and cleanup inside an owned future polled
by the caller's single foreground task. Apply the same ownership rule to
the application auth facades without changing their public API. Dropping
an unpolled operation sends no request; after publication, SDK
cancellation and request-scoped elicitation cleanup remain intact.
Release Notes:
- N/A
- Send typed ACP v2 `session/cancel` notifications from the inactive
external adapter. Session cancellation does not withdraw a prompt RPC or
erase acceptance evidence.
- Separate fallible cancellation requests from completion observation.
Reported Idle completes an active receipt-mode stop; EOF ends
observation with an error, preserves last reported activity, and closes
future cancellation observers.
- Propagate failures through Stop, subagent Stop, interrupt-and-send,
queued Send Now, checkpoint restoration and native truncation. Failed
stops retain the composer draft and restore queued messages in their
original order with automatic processing paused.
- Preserve legacy completion behavior while preventing a failed
cancellation request from replacing the running legacy turn. Update
native/v1 adapters, eval CLI signal/timeout handling and test doubles
for the fallible contract.
Release Notes:
- N/A
Real adapter-created threads now select receipt mode during
construction, send acceptance requests, correlate user-message echoes
and consume reported activity without treating RPC completion as turn
completion.
- Use one owner-aware `ReceiptSessionSubmissions::submit` operation,
replacing the overlapping prompt/submit entry points. The v2 adapter
pins publication to the submitting entity; native and stub transports
use the same carrier with ordinary, unacknowledged responses.
- Select the capability before registration completes, rather than
permanently leaving new threads in legacy mode because their map entry
does not exist yet.
- Validate baseline versus advertised image/audio/embedded-context
prompt content before publication, including calls through the low-level
prompt helper. Keep source content unchanged.
- Separate receipt delivery from application with `ReceiptSubmission`.
The shared tracker commits success or failure before acknowledging; SDK
dispatch then finalizes request-scoped input before releasing later
traffic. This replaces the scheduler/no-yield contract with an explicit
handshake and reuses the existing submission state machine.
- Distinguish callback/transport loss from wire rejection and reuse
shared disconnect settlement. No second submission state machine,
automatic resend, synthetic Idle or LegacyCompleted response.
Release Notes:
- N/A
- Add `Disconnected { receipt: Option<PromptResponse> }`. Preserve the
exact receipt when acceptance is known; absence means acceptance is
unknown, not that the agent rejected the message.
- Transition pending and accepted-but-un-echoed records idempotently.
Retain their source content for recovery and allow explicit dismissal
rather than keeping them permanently unsettled or silently pruning them.
- Wake pending receipt observers and drop their pending response
futures. Do not infer that remote execution stopped, send session-wide
cancellation, or retry/resubmit.
- Keep disconnected records terminal. A ready acceptance receipt may
enrich an unknown record without reopening it; late failures,
cancellation and conflicting receipts cannot replace the disconnected
outcome or erase existing acceptance evidence.
- Recognize the SDK's stable incoming-EOF discriminator even if a
request failure settles before the canonical cleanup callback. Document
`SubmissionDisconnected` as the error-context contract for other
transport failures, preserving the distinction from ordinary agent error
responses.
- Reuse the canonical foreground disconnect cleanup for registered
owners. Rename its formerly elicitation-only helper to reflect the
expanded responsibility. Legacy completion-mode owners are unchanged.
- Adapt the existing recovery rows to distinguish known acceptance from
unknown acceptance. Keep Copy/Discard, but do not offer Restore for
these uncertain/accepted records or overwrite an existing draft. This is
not a new retry UI.
Release Notes:
- N/A
- Add `AcpV2Connection::request_prompt_receipt`, gated on the advertised
baseline session capability. Return the agent's v2 message-ID receipt
without waiting for execution or Idle.
- Reuse the existing auth request-scope helper, renaming it and its
scope handlers to reflect their use by both auth and prompt requests.
Request publication, caller-drop RPC cancellation, request-scoped
elicitation cleanup, SDK error mapping and foreground completion
barriers are otherwise unchanged.
- Preserve typed prompt content, session IDs, request metadata, receipt
metadata and SDK error records. Do not synthesize completion responses,
resend requests or send `session/cancel` on caller drop.
- Extend the existing SDK-channel harness, rather than adding another
transport or model adapter.
Release Notes:
- N/A
- Add three production lines to the existing session-update enum, SDK
decoder and foreground application match. Reuse
`AcpThread::update_session_state`, including its receipt-capable-owner
guard.
- Exercise Running/RequiresAction/Idle without any prompt submission or
outstanding prompt RPC. Preserve full state snapshots, payload metadata,
custom/future state, stop reasons and idle usage through the existing
reducer; repeated Idle must not emit another stop.
- Check per-session routing, unknown sessions, mismatched owners,
explicitly released-but-still-alive owners, dropped owners and legacy
rejection through the existing SDK-channel harness.
- Update fallthrough expectations now that state updates are handled.
Keep unknown updates and unsupported plan forms falling through,
including known-envelope metadata and extension fields.
Release Notes:
- N/A
- Create real `AcpThread` owners for `session/new`, with an ordered SDK
response callback held until foreground registration and initial
config/command application finish. Use the shared foreground/session
owners and one SDK transport.
- Apply working directories from the request actually sent. Pinned
schema 1.11.0's new-session response contains ID, config and commands,
not a `SessionInfo` object; later info notifications update the existing
owner. Delivery `_meta` is not treated as retained session-info
metadata.
- Add authoritative `session/set_config_option` responses using the same
ordered-response helper. Validate advertised IDs/values before
publication and reject released/replaced owners before response
application. Notify the existing config watcher and thread events; later
notifications remain authoritative.
- Gate session creation, additional roots and MCP transports on actual
offered capabilities. Share project MCP selection/local-remote routing
with v1, with version-specific wire builders. Preserve stdio
command/args/env and HTTP URL/headers; validate required absolute paths
before publication using the project path style, not the client host’s
PathBuf rules.
- Generalize the existing caller-owned request scopes to
new-session/config RPCs, including pre-session input, failure, caller
cancellation and late-input rejection. Close an abandoned returned
session without awaiting another RPC inside an ordered SDK callback.
Reject duplicate IDs without closing or replacing the original owner.
Release Notes:
- N/A
- Move `AcpConnection`, its defaults, the v1 builder/capabilities/wire
handlers, legacy session/config/MCP operations and session-list
implementation into `acp/v1.rs` alongside `acp/v2.rs`.
- Keep foreground routing/context, shared session/config data, v2 client
ingress, canonical permission/elicitation application, shared
terminal-auth construction and error/lifecycle helpers in the
root/shared modules.
- Keep only the v1 config-setting wire method on the shared config data
in `v1.rs`; the shared constructor/state stays in the root. The existing
mixed session record is not redesigned in this extraction.
- Preserve public paths through root reexports (`AcpConnection`,
`AcpSessionList`, `connect`, the Gemini terminal-auth constant and
conditional `test_support`). Consumer call sites are unchanged. The
shared-runtime test imports the moved private v1 driver directly.
- Keep compatibility/ingress tests alongside the legacy harness they
exercise; v2 connection/auth tests stay in `v2.rs`. Test names gain the
v1 module prefix but their bodies and scheduler behavior are unchanged.
## Review
This is a large source relocation, not thousands of new implementation
lines. For copy-aware review:
```sh
git diff -B -M origin/main...HEAD -- crates/agent_servers/src/acp.rs crates/agent_servers/src/acp/v1.rs crates/agent_servers/src/acp/runtime.rs
```
Git recognizes `v1.rs` as a 93%-similar copy of the old adapter. Review
the retained root boundary and the small import/visibility changes
rather than re-reviewing unchanged test bodies.
Release Notes:
- N/A
Activate native acceptance and reported state atomically with its
completion consumers.
- Return acceptance with the retained message ID. Session-owned drivers
report running/requires-action/idle independently of receipt and
completion observers.
- Keep completion observers native-only for subagents and eval. Native
no longer implements the legacy completion-based prompt path; external
v1 behavior and SDK/wire rollout pins remain unchanged.
- Preserve checkpoints, rewind, command expansion order, retained source
fields, usage and provider-shaped persistence. Compact markers retain
identity without user bubbles.
- Use `NativeRetryAction` for retained command intent. Failed
preparation retries the resolved action; prepared history resumes
without duplicate expansion.
Prerequisites #65502 and #65504 are merged. This PR targets `main`;
conflicts are resolved and only the six-file native slice remains.
Validation on the merged base: **1,815 tests passed, 11 ignored**;
100-seed native/subagent/E2E-helper/skill-body checks; eight-crate
Clippy; test-target and E2E-feature compilation; both Zed binary checks;
formatting and diff checks. Scoped conflict-resolution review passed.
Credentialed live E2E/provider, live SIGTERM and non-macOS workflows
remain unrun.
Review thread:
https://delta.dev/trunk/join/thread_01m4e0prq2aaq6k0avcqe3688r#s=Deoszm1s
Release Notes:
- N/A
- Use one internal `ClientRuntime` for foreground queue/context dispatch
and SDK I/O ownership. Keep typed v1/v2 builders, initialization,
capabilities, auth requests and session semantics in their adapters; no
generic protocol-version framework.
- Share handle publication, cooperative owner shutdown and the
idempotent cleanup awaited by both SDK close callbacks and
transport-error paths.
- Share startup-versus-process-exit races, the existing 250 ms
error/exit preference, stdout/foreground/stderr exit draining and
process watching. Adapters still decide how to publish their exit
errors; v1 wait failures are now logged rather than held in an
unobserved task result.
- Reuse the child guard for both protocols, including failed or
abandoned v1 startup. Give real v1 connections the same cooperative
cleanup as v2 instead of immediately cancelling I/O/dispatch tasks when
their owner drops. Existing raw test drivers retain their cancel-on-drop
ownership.
Release Notes:
- N/A
Add an unselected `AcpV2Connection` for real SDK v2 initialization and
Agent auth, using the existing stdio launcher/logging, consolidated
client ingress, terminal-auth task builder and canonical elicitation
cleanup.
- Retain sent initialization and received capabilities/info/auth
methods. Missing auth methods disable login/logout even when
`capabilities.auth` exists; advertised methods enable logout. Agent
login rejects terminal/unknown methods, and opaque metadata does not
authorize terminal execution.
- Advertise terminal authentication only when a configured agent
invocation is available; reuse the first-class terminal route and its
command/argument/environment placement.
- Publish auth requests before installing caller-drop cleanup. Cancel
using the SDK handle and queue elicitation cleanup by the actual parent
RPC ID, without duplicating SDK settlement state or mutating foreground
entities from a destructor.
- Track caller-owned live RPC IDs in the v2 foreground context before
publication, not SDK settlement state. Closed scopes reject new
elicitations, including late input from a non-cooperative peer. Success
cancels unanswered input but preserves accepted URL entries for
completion notifications; cancellation/failure retains broader cleanup.
V1 and ingress-only contexts retain their existing behavior.
- Retain the foreground owners through cooperative SDK shutdown so a
displayed store is settled after EOF or connection destruction. Startup
failure/abandonment also reaps the owned child; process-exit diagnostics
reuse the existing stderr drain.
This type does **not** implement `AgentConnection` and is not selected
by the production factory. Existing v1 negotiation and beta behavior
remain unchanged. No session creation, config/MCP RPCs, prompt receipts,
activity or rollout/fallback selection changes.
Release Notes:
- N/A
Remove unnecessary v1 schema coupling from JSON-RPC bookkeeping and
selected current application fixtures.
- Debug logs and ACP tools use shared `RequestId` (the pinned SDK
exposes it through `schema::v2`) and SDK runtime `Error`, preserving
payloads, error data and request/response bookkeeping.
- Add a one-shot application-action option to the existing stub prompt
queue. Current fixtures call canonical owners directly, without a
duplicate v2 notification decoder or a separate queue. Legacy scripted
updates, permissions and completion semantics remain available.
- Migrate the default UI response, message-after-elicitation fixture and
native image-tool visual fixture to current values. Keep native tool
content/locations in v2 rather than converting them back to v1.
- Retain explicit v1 persistence/import regressions and rename the
legacy diff-renderer test to make its purpose clear. This is targeted
fixture payload cleanup, not a receipt-mode migration of the
completion-based stub.
Release Notes:
- N/A
- Register complete v2 permissions with the generic permission owner,
preserving subjects, offered options and metadata without creating tools
or inferring approval from unknown hints.
- Route session- and request-scoped elicitations to their existing
owners. Share elicitation registration/waiting/cancellation/completion
with v1, keeping v1 response conversion at the adapter boundary.
- SDK callbacks only enqueue work. Foreground response tasks retain weak
owners and cancel by the exact returned local entry ID, not a subject or
URL ID. Already-cancelled requests are rejected before owner
registration.
- URL completion uses the canonical consent/completion behavior;
completion metadata does not patch request metadata.
Release Notes:
- N/A
- Replace the existing session config owner's full option list,
installing it on the first update when absent. Notify config subscribers
before emitting the thread event. Preserve option/value metadata,
unknown kinds and ordering; an empty list clears the options.
- Use one usage reducer for v1 and v2. Update context-used/window totals
without resetting input/output counters. A supplied cumulative cost
replaces the prior report and retains cost metadata; omitted and null
costs preserve it because the pinned schema decodes both as
`Option::None`.
- Require a live thread before connection-side effects. Extend the
existing cross-session/release/queued-owner-drop regression so a stale
map entry cannot mutate a retained config owner.
## Merge validation
Merged `main` at `a63db9fd901bed` via ordinary merge commit
`5d0ac326d8d55d`; retained configuration/usage and notice/compaction
handlers and tests. Production negotiation remains v1.
Local checks passed on the combined result:
- `SEED=100 ITERATIONS=100 cargo test -p agent_servers --lib v2_
--locked -- --test-threads=1`: 13 SDK tests across seeds 100–199.
- `cargo test -p acp_thread -p agent -p agent_servers -p agent_ui -p
sidebar --lib --locked -- --test-threads=1`: 1,821 passed, 11 ignored.
Serial execution avoids the previously established unrelated
migration-fixture baseline issue.
- `GITHUB_ACTIONS=true ./script/clippy -p acp_thread -p agent -p
agent_servers -p agent_ui -p sidebar -p acp_tools -p feature_flags
--locked`.
- `cargo check -p acp_thread -p agent -p agent_servers -p agent_ui -p
sidebar -p acp_tools --tests --features
agent_servers/e2e,agent_ui/unit-eval --locked`.
- `cargo check -p zed -p eval_cli --bin zed --bin eval-cli --locked`.
- `cargo fmt --all -- --check` and diff whitespace checks.
Only existing macOS linker unwind-table and `block v0.1.6`
future-compatibility warnings appeared. Live-server E2E tests and manual
UI testing were not run; E2E consumers were compiled. GitHub CI is
running separately.
Release Notes:
- N/A
- Bind the existing specialized terminal decoder to the common inactive
v2 session ingress, using the same foreground queue, live-session lookup
and application path as messages/tools/plans.
- Keep the standalone terminal builder API, parsing/base64 checks and
decoder unchanged. The specialized terminal handler runs before typed
session dispatch, preserving existing terminal validation without
changing typed message/tool/plan handling.
Release Notes:
- N/A
- Extend the inactive typed v2 session ingress with tool-call patches,
streamed tool content and structured keyed-plan snapshots, reusing the
existing foreground queue and live session lookup.
- Route tool patches through the wire updater, not the native/local
updater, so agent-owned display references can be created and resolved
without becoming client process handles.
- Keep plan-entry, plan and update metadata distinct from delivery
metadata. File, markdown and custom plan forms remain unclaimed rather
than replacing retained structured plans.
Release Notes:
- N/A
- Add inactive v2 message ingress for user/agent/thought snapshots and
chunks, binding an SDK v2 builder to the existing foreground queue and
live session registry.
- Feed the existing shared message reducers directly. Preserve per-type
IDs, first-seen placement, historical updates, content/unknown values,
item metadata and omission/null/value behavior; delivery and chunk
metadata do not patch message metadata.
- Resolve weak session owners at application time. Unknown sessions and
updates after owner removal are ignored; existing close/final-output
draining is unchanged.
Production connections still initialize as v1.
Release Notes:
- N/A
- Normalize SDK transport and typed v1/v2 errors through a borrowed
protocol-error view, with consistent numeric RPC codes.
- Recognize typed authentication-required errors during initial session
creation and use the same marker-first auth-description rule for thread
errors.
- Retain the original SDK error, including its message and structured
data, beneath adapter auth context and through prompt failures.
Release Notes:
- N/A
Normalize application-facing mode presentation and saved-default APIs
onto the existing v2 config select-choice types.
- [Shared mode
contracts](https://github.com/zed-industries/zed/blob/baf15a799b2caf9c83766c8cdbdb7b187d109ccf/crates/acp_thread/src/connection.rs#L353-L359)
and mode-update events use v2 value IDs; legacy choices retain opaque
IDs, labels, descriptions, metadata and order.
- Keep the current config-options-first UI and the legacy mode-selector
fallback. No synthetic config option ID or new mode DTO; selection,
cycling, keybindings and tool-availability wire operations are
unchanged.
- Server default-mode APIs use v2 value IDs, while persisted
`default_mode` remains a string, separate from `default_config_options`.
No settings migration.
- V1 mode state and `session/set_mode` stay in the external adapter,
with the same optimistic selection and failure rollback.
Release Notes:
- N/A