docs: add agent cancellation documentation#648
Merged
pgrayy merged 9 commits intostrands-agents:mainfrom Mar 12, 2026
Merged
Conversation
Contributor
Documentation Preview ReadyYour documentation preview has been successfully deployed! Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-cms-648/docs/user-guide/quickstart/overview/ Updated at: 2026-03-12T17:37:07.169Z |
Contributor
There was a problem hiding this comment.
Assessment: Request Changes
The documentation clearly explains the new agent.cancel() feature with good coverage of checkpoints, thread-safety, and the distinction from interrupts. There is one issue that needs addressing in the Python code example.
Review Details
- Code Example: The Python example uses
awaitat module level without an async function wrapper - this is invalid Python syntax that will confuse users - Content Quality: Clear explanations of cancellation behavior, checkpoints, and conversation state handling
- Consistency: TypeScript placeholder is appropriate; links are valid
Good addition to the agent loop documentation!
Contributor
Documentation Preview FailedThe documentation deployment encountered an error. Please check the deployment logs for more details. |
Contributor
Documentation Preview FailedThe documentation deployment encountered an error. Please check the deployment logs for more details. |
mehtarac
approved these changes
Mar 12, 2026
…cs/add-cancellation-docs
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.
Description
Documents the
agent.cancel()feature added in strands-agents/sdk-python#1772. Adds a Cancellation subsection to the Agent Loop page covering the newcancel()method, its checkpoints (streaming and pre-tool-execution), thread-safety, and how it differs from interrupts. Also addscancelledto the stop reasons list.Content is placed within the existing agent-loop page rather than a standalone page since the feature is a single method producing one new stop reason.
Related Issues
strands-agents/sdk-python#1772
strands-agents/sdk-python#81
Type of Change
Checklist
npm run devBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.