Skip to content

docs: add agent cancellation documentation#648

Merged
pgrayy merged 9 commits intostrands-agents:mainfrom
pgrayy:docs/add-cancellation-docs
Mar 12, 2026
Merged

docs: add agent cancellation documentation#648
pgrayy merged 9 commits intostrands-agents:mainfrom
pgrayy:docs/add-cancellation-docs

Conversation

@pgrayy
Copy link
Copy Markdown
Member

@pgrayy pgrayy commented Mar 12, 2026

Description

Documents the agent.cancel() feature added in strands-agents/sdk-python#1772. Adds a Cancellation subsection to the Agent Loop page covering the new cancel() method, its checkpoints (streaming and pre-tool-execution), thread-safety, and how it differs from interrupts. Also adds cancelled to 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

  • New content

Checklist

  • I have read the CONTRIBUTING document
  • My changes follow the project's documentation style
  • I have tested the documentation locally using npm run dev
  • Links in the documentation are valid and working

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 12, 2026

Documentation Preview Ready

Your 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

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 await at 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!

@github-actions
Copy link
Copy Markdown
Contributor

Documentation Preview Failed

The documentation deployment encountered an error. Please check the deployment logs for more details.

@github-actions
Copy link
Copy Markdown
Contributor

Documentation Preview Failed

The documentation deployment encountered an error. Please check the deployment logs for more details.

@pgrayy pgrayy temporarily deployed to manual-approval March 12, 2026 14:16 — with GitHub Actions Inactive
@pgrayy pgrayy dismissed github-actions[bot]’s stale review March 12, 2026 17:37

addressed comments.

@pgrayy pgrayy merged commit 41537cf into strands-agents:main Mar 12, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants