You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a5af768
Browse filesBrowse the repository at this point in the historyBrowse files
feat(acp)!: answer dropped request responders with an error (#462)
A request handler that dropped its `Responder` without responding left the
peer waiting forever. On a v2 connection, dropping the `initialize`
responder also left the connection stuck initializing, so a retry was
rejected as "already in progress".
The SDK now answers such a request itself: with -32800 (Request cancelled)
if the peer had cancelled it via `$/cancel_request`, and otherwise with
-32603 (Internal error) whose data names the method. Nothing is sent when a
response was already sent or handed off (e.g. `forward_response_to`), while
another owner still holds the responder, or once the connection is shutting
down or terminated. If the handler that dropped the responder returns an
error, that error is the response instead of the fallback.
The fallback goes through the normal response path, so a dropped
`initialize` responder fails initialization like any other error: a first
`initialize` leaves the connection uninitialized and can be retried, and a
failed repeat keeps the previous initialization.
BREAKING CHANGE: dropping a `Responder` without responding now sends an
error response for the request (-32603, or -32800 if the peer cancelled the
request) instead of sending nothing. Handlers that intentionally dropped a
responder and answered the request some other way must now keep the
responder and respond through it.
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments