Skip to content

fix: align ACP v2 runtime and connection hooks with v1 - #217

Open
PsiACE wants to merge 1 commit into
mainfrom
fix/v2-align-runtime-and-hooks
Open

PsiACE wants to merge 1 commit into
mainfrom
fix/v2-align-runtime-and-hooks

Conversation

@PsiACE

@PsiACE PsiACE commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Aligns ACP v2 runtime behavior and connection hooks with v1 conventions and cleans up minor nits.

Summary

  • Match v1 extension calling convention in v2: ext_method / ext_notification prepend _ on send and strip _ on receive, while keeping v2 inherited-stub semantics (-32601 / ignored).
  • Start background receive loops only after on_connect succeeds across v1 and v2 connections so hook failures do not leak receive tasks, and align v2.AgentSideConnection with v1's public listening parameter and listen() method.
  • Allow v2 clients to repeat initialize before the first non-initialize request (restoring prior state only on remote rejection, closing on incompatible responses), fail fast on agent sends during initialize, and lock AgentProtocolRouter to the negotiated protocol version after the first successful initialize (rejecting cross-version switches with -32600).
  • Preserve model_extra fields for custom v2 elicitation modes, remove unused router aliases, and export acp.__version__.

Verification

  • make gen-check
  • make check
  • make test (694 passed, 1 skipped, 0 warnings)

@PsiACE
PsiACE force-pushed the fix/v2-align-runtime-and-hooks branch from 4cab7b3 to b2d82fd Compare November 29, 2026 06:36
@PsiACE
PsiACE force-pushed the fix/v2-align-runtime-and-hooks branch from b2d82fd to a882555 Compare November 29, 2026 07:23

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