Skip to content

chore: update ACP SDK to 1.8 - #621

Open
OldKrab wants to merge 1 commit into
agentclientprotocol:mainfrom
OldKrab:shushakov/bump-acp-sdk-1.8
Open

OldKrab wants to merge 1 commit into
agentclientprotocol:mainfrom
OldKrab:shushakov/bump-acp-sdk-1.8

Conversation

@OldKrab

@OldKrab OldKrab commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Bumps @agentclientprotocol/sdk from ~1.5.0 to ~1.8.0 and adapts the v2 code to the regenerated schema types. The pin did not move with #620, and 1.6–1.8 each add type errors against current main (1, 4 and 6 respectively).

Type fixes

  • CodexAuthMethod.ts: v1 AuthMethod is now a union with terminal methods, whose env has a different shape on v2. Every Codex method is agent-handled, so the constants and getCodexAuthMethods are typed as AuthMethodAgent. No wire change.
  • AcpV2Prompt.ts, CodexAcpServer.ts: the v2 idle state is now a union per stop reason, which TypeScript does not match against a union-typed stopReason. toV2IdleState carries the one cast, and the unowned-turn path reuses it. No wire change.
  • ACPSessionConnection.ts: startReplayMessage builds one literal per message kind for the same reason. No wire change.
  • AcpV2SessionUpdate.ts:
    • command input is tagged without carrying the untagged v1 input type. input: null and an absent input are preserved; only the key order of the rendered object changes, hence the one snapshot update.
    • v1 SessionUpdate gained subagent_update, session_message and session_message_chunk. The adapter does not emit them, so toV2SessionUpdate rejects them like async_task_progress.
    • the comment on _subagent_update said subagent_update was not in the v2 unstable schema yet; it is as of this SDK, so the comment now says the payload does not have its fields yet.

Behavior change to review

SDK 1.5 stripped clientCapabilities.subagents while parsing initialize (noted in #592). SDK 1.8 keeps it, so clientSupportsSubagents now returns true for any v1 client that advertises the capability, not only AIR clients with nativeSubagentSessions. Such a client then receives subagent_spawned / subagent_state_update, while the current RFD defines the capability as understanding subagent_update.

This PR does not change that code. If the earlier-draft updates should stay AIR-only until the v1 path moves to subagent_update, the top-level check in clientSupportsSubagents needs removing in the same release; happy to add that here.

Verification

  • npm run typecheck
  • npm run build
  • npm test (1714 passed, 36 skipped)

🤖 Generated with Claude Code

Adapt the v2 code to the regenerated schema types:
- type the Codex auth methods as agent methods, now that v1 auth methods
  are a union with terminal methods
- build the v2 idle state and replayed whole-message updates in forms the
  v2 unions accept
- tag v2 command input without carrying the untagged v1 input type
- reject the v1 subagent_update and session message updates on v2, which
  the adapter does not emit

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant