Repository navigation
docs(unstable-v2): state the error codes for tool_call/cancel and terminal/cancel - #2869
Merged
Merged
Conversation
…minal/cancel The error page gave two answers for a cancel request on an item that does not advertise `capabilities.cancel`. Its rule for capability-gated methods requires `-32601`, while the tool calls page gives `-32602`. - Say that the two methods are gated per tool call or terminal, not by a capability in `initialize`, and that an Agent that implements them answers `-32602` for an item that does not advertise `cancel`. - Name both methods in the unknown-session rule, which requires `-32002` for any session-scoped request.
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
The v2 error page and the tool calls page gave different error codes for a
tool_call/cancelorterminal/cancelrequest on an item that does not advertisecapabilities.cancel. This states one answer on the error page. Both edits are made in the stable page and itsdraft/copy.Changes
cancel:-32602. The rule for capability-gated methods requires-32601, and it read as covering these two methods. The tool calls page, the Background Work RFD and the schema descriptions all give-32602. The error page now says the two methods are gated per tool call or terminal, not by a capability ininitialize, and that an Agent that implements them answers-32602.sessionId:-32002. The unknown-session rule already requires-32002for any session-scoped request. Its list of methods now namestool_call/cancelandterminal/cancel.Why
-32602for the itemcancel, for example when the tool call finishes.-32601would tell the Client that the Agent has no such method.An Agent that implements neither method still answers
-32601.Follow-up
claude-agent-acpanswers-32602when thesessionIdof a cancel request is unknown, because it looks the item up before it checks the session. That needs a fix in the adapter.Checks
typospass on the changed files.