Repository navigation
docs(unstable-v2): scope cancellation to the foreground work it stops - #2929
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.
session/cancelstops the named session's foreground work, not its update stream. The spec previously required content and tool-call updates after the notification to precedeidle(cancelled), even though a listed background tool can still be running when that idle update is sent.This change makes the ordering explicit:
idle(cancelled), before starting new foreground work in that session. Listed background work can keep reporting progress and its final status afterward.idle(cancelled).The baseline and Draft guides, migration guide, RFDs, and generated references agree on both races. No wire fields, method names, or v1 behavior change.
Validation:
npm run generate,npm run check, baseline-v2 schema generator and cancellation tests, and Mintlify validation and link checks for the changed pages. Five focused Claude adapter tests also passed.Downstream follow-up: With foreground work blocked on permission, I sent a held prompt,
session/cancel, and then a distinct new prompt back-to-back over stdio to the TypeScript example at91fb159. It returned-32800for both prompts; only the first was covered. The RFD records this trace and the surviving-background-tool trace for conformance tests. This PR does not change either the SDK or the external TCK.