Skip to content

agent_servers: Add inactive v2 connection and auth foundation - #65582

Merged
benbrandt merged 2 commits into
mainfrom
benbrandt/acp-v2-connection-auth-foundation
Oct 14, 2026
Merged

benbrandt merged 2 commits into
mainfrom
benbrandt/acp-v2-connection-auth-foundation

Conversation

@benbrandt

@benbrandt benbrandt commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

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

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Oct 14, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Oct 14, 2026
@benbrandt
benbrandt added this pull request to stack #65604 October 14, 2026 18:21
@benbrandt
benbrandt marked this pull request as ready for review October 14, 2026 18:21
@benbrandt
benbrandt requested a review from bennetbo October 14, 2026 18:22
@benbrandt
benbrandt added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit a90dedb Oct 14, 2026
41 checks passed
@benbrandt
benbrandt deleted the benbrandt/acp-v2-connection-auth-foundation branch October 14, 2026 18:58
amirkhakshour pushed a commit to SourceShift/zed-mini-ork that referenced this pull request Oct 18, 2026
…dustries#65582)

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
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.

2 participants