Repository navigation
fix: follow the remaining ACP schema 1.13 rules in Testy, examples, and docs - #452
Merged
Merged
Conversation
Testy v2 and the simple_agent_v2 example return every session in one page and never issue nextCursor, so any cursor a client sends is invalid and must fail with -32602, matching v1 Testy. Co-Authored-By: Claude <noreply@anthropic.com>
The v2 session-setup page says agents SHOULD send current session info via session_info_update after any requested replay and before the resume response, even without replayFrom. Testy v2 now does so alongside the idle-state snapshot, as simple_agent_v2 already does. md/testy.md now documents this, the baseline prompt content and session/list cursor rules, and that the v2 prompt response carries the accepted user message's messageId rather than being empty. Co-Authored-By: Claude <noreply@anthropic.com>
The v2 with_mcp_server builders declare an acp MCP server, which a conforming agent rejects with -32602 unless it advertises session.mcp.acp. Say so in their rustdoc and the protocol v2 chapter, and point to a compatibility proxy such as McpOverAcpPolyfill for agents without it. The Schema 1.13 section also lists the new _meta fields on DiffPatch, ToolCallPermissionSubject, and Icon, and the v1 downgrade notes that terminal authentication is kept. Co-Authored-By: Claude <noreply@anthropic.com>
V2Session::close now documents the session/close ordering: it cancels like session/cancel, sends final updates and idle(cancelled) before the close response, fails uninserted prompts with -32800, and leaves later commands to fail with -32002. The Responder::cancellation and cancellation chapter no longer suggest answering a cancelled request with partial data: a successful response is only allowed where the method defines one for cancellation, and -32800 otherwise. The error handling chapter notes the reserved JSON-RPC and ACP error code ranges. Co-Authored-By: Claude <noreply@anthropic.com>
…put in clients The v2_one_shot_client example answered every permission request with the cancelled outcome without sending session/cancel. It and the cookbook's v2 recipe now select the agent's reject_once option by kind and fall back to session/cancel plus the cancelled outcome only when none is offered. Both now treat any non-idle state, including StateUpdate::Other, as active foreground work, since clients must show unrecognized states as busy and never as idle. yopo and v2_one_shot_client strip control characters other than newline and tab from agent text before printing it, so untrusted escape sequences cannot manipulate the terminal. Co-Authored-By: Claude <noreply@anthropic.com>
…rade Schema 1.12 removed Next Edit Suggestions and their position-encoding capabilities, so v1 ClientCapabilities no longer has nes or positionEncodings fields. Copying those keys during the v1 downgrade was dead code: typed v1 decoding discarded them anyway. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Follow-ups to the schema 1.13 update (#443, #444) that bring Testy, the examples, and the docs in line with the remaining v2 spec changes. #450 already covered the prompt-content rejection,
simple_agent_v2's resume session info, and most of the Schema 1.13 section, so this branch adds only what that left out.Each commit can be reviewed on its own:
simple_agent_v2rejectsession/listcursors. Neither issues anextCursor, so any cursor a client sends is invalid and gets-32602, as v1 Testy already does.md/testy.mddocuments this, the prompt-content and cursor rules, and that the prompt response carriesmessageId.with_mcp_serverbuilders declare anMcpServer::Acpserver, which a conforming agent rejects with-32602unless it advertisessession.mcp.acp. The rustdoc and the protocol v2 chapter now say so and point toMcpOverAcpPolyfill. No runtime capability check is added. The Schema 1.13 section also lists the new_metafields, and the v1 downgrade notes that terminal auth is kept.V2Session::closerustdoc now describes the close ordering from the spec. The cancellation docs no longer suggest answering a cancelled request with partial data: a successful response is allowed only where the method defines one, and-32800otherwise. The error-handling docs note the reserved code ranges.v2_one_shot_clientand the cookbook's v2 recipe decline permission requests with the agent'sreject_onceoption. They fall back tosession/cancelplus the cancelled outcome only when there is no such option.yopoandv2_one_shot_clientstrip control characters from agent text before printing it, per the security considerations.nesandpositionEncodings, which schema 1.12 removed.Testing:
cargo fmt --all --checkcargo clippy --workspace --all-targets --all-features --lockedcargo test --workspace --all-features --locked --exclude agent-client-protocol-derive: 951 passedThe derive crate's tests were excluded because their test binary fails to load locally (a dyld rpath issue in the local runner); none of these commits touch that crate.