refactor(v2)!: expand parameters and derive routes from protocols - #150
Merged
Merged
Conversation
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
V2 connection methods and agent/client handlers now accept expanded snake-case parameters, matching the v1 calling style. For example,
connection.new_session(NewSessionRequest(cwd="/workspace"))becomesconnection.new_session(cwd="/workspace"). Nested values and responses remain v2 schema models; extra keyword arguments carry_meta.Add public
v2.Agentandv2.Clientprotocols and derive routing specifications from theirparam_modelmetadata and return annotations. V2 retains separate contracts because initialization, prompt responses, permissions, and session updates differ from v1.Preserve initialization gating, strict request/response validation, prompt acceptance acknowledgements, independent session updates, omitted-versus-null patch fields, union branch fields, separate MCP request/notification dispatch, and explicit extension names. Unimplemented protocol stubs remain unhandled. Signature generation now selects the appropriate schema version.
Breaking experimental API change: callers and handlers must migrate from whole request models to expanded parameters. Stable v1 APIs are unchanged. No schema bindings were regenerated.
Related issues
Follow-up to #149.
Testing
make check— passed (lint/format, type checking, dependency checks).UV_PROJECT_ENVIRONMENT=/tmp/acp-python-ci310 NO_PROXY=localhost,127.0.0.1 no_proxy=localhost,127.0.0.1 uv run --python 3.10 --frozen --all-extras python -m pytest --doctest-modules -q— 356 passed, 2 skipped.NO_PROXY=localhost,127.0.0.1 no_proxy=localhost,127.0.0.1 uv run --frozen --all-extras python -m pytest --doctest-modules -q— 357 passed, 1 skipped.Docs & screenshots
Updated
docs/experimental-v2.mdwith expanded calls, agent/client implementations, union request examples, and migration guidance.Checklist