Repository navigation
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps
@agentclientprotocol/sdkfrom~1.5.0to~1.8.0and 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 currentmain(1, 4 and 6 respectively).Type fixes
CodexAuthMethod.ts: v1AuthMethodis now a union with terminal methods, whoseenvhas a different shape on v2. Every Codex method is agent-handled, so the constants andgetCodexAuthMethodsare typed asAuthMethodAgent. No wire change.AcpV2Prompt.ts,CodexAcpServer.ts: the v2idlestate is now a union per stop reason, which TypeScript does not match against a union-typedstopReason.toV2IdleStatecarries the one cast, and the unowned-turn path reuses it. No wire change.ACPSessionConnection.ts:startReplayMessagebuilds one literal per message kind for the same reason. No wire change.AcpV2SessionUpdate.ts:input: nulland an absentinputare preserved; only the key order of the rendered object changes, hence the one snapshot update.SessionUpdategainedsubagent_update,session_messageandsession_message_chunk. The adapter does not emit them, sotoV2SessionUpdaterejects them likeasync_task_progress._subagent_updatesaidsubagent_updatewas 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.subagentswhile parsinginitialize(noted in #592). SDK 1.8 keeps it, soclientSupportsSubagentsnow returns true for any v1 client that advertises the capability, not only AIR clients withnativeSubagentSessions. Such a client then receivessubagent_spawned/subagent_state_update, while the current RFD defines the capability as understandingsubagent_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 inclientSupportsSubagentsneeds removing in the same release; happy to add that here.Verification
npm run typechecknpm run buildnpm test(1714 passed, 36 skipped)🤖 Generated with Claude Code