docs: correct cancellation and stop behaviour across the docs - #238
Merged
Conversation
A sweep of every first-party doc against the behaviour changed in this PR turned up three stale or missing pieces: - docs/cli.md promised Ctrl+C "finishes the in-flight attack". It now finishes the in-flight turn, which is the point of the change — the old wording described the bug as if it were the contract. - docs/browser-extension.md never documented Stop or Pause at all, though both are prominent controls and this PR changed what a stopped run leaves behind. Added what each produces, and corrected the neighbouring limitation that read as though pause did not exist. - AGENTS.md said the SDK "can reuse the same mechanism" for cancellation, which reads as though it already does; runners/sdk accepts no signal. Verified against the code rather than recollection: the extension checks for a stop between sending a message and reading the reply, so it can abandon a sent turn — the docs now say so instead of claiming turns always complete. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
WalkthroughThe documentation now describes SDK cancellation limits, browser extension pause and stop behavior, and CLI interruption handling between turns. ChangesCancellation documentation
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
jithin23-kv
approved these changes
Aug 6, 2026
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.
Problem
Follow-up to #236. That PR changed cancellation from attack-granular to turn-granular and changed what a stopped extension run leaves behind, but the user-facing docs still described the old behaviour. A sweep of every first-party doc against the merged code turned up three gaps:
docs/cli.mdpromised the wrong thing. The "Graceful shutdown (Ctrl+C)" table said the first Ctrl+C "finishes the in-flight attack" — which described the bug fix: cancellation turn-granularity, extension report gaps, and cache-aware cost pricing #236 fixed as if it were the contract. A user reading it would still expect aturns: 100attack to run to completion before stopping.docs/browser-extension.mdwalks through the run flow but never mentioned either control, despite both being prominent buttons and fix: cancellation turn-granularity, extension report gaps, and cache-aware cost pricing #236 changing what a stopped run produces (it now yields a report with token usage and cost rather than nothing). The neighbouring limitation — "No pause / resume across sessions" — reads as though pause doesn't exist at all; it actually meant a paused run doesn't survive uninstall.AGENTS.mdoverstated SDK support. It said the SDK "can reuse the same mechanism" for programmatic cancellation, which reads as though it already does.runners/sdkaccepts nosignaloption.Solution
docs/cli.md— corrected the shutdown table to say turn, and added what that buys you: stopping costs one turn's latency (a model call plus a target call) however highturnsis set. Also noted that the interrupted attack is still judged on the transcript it collected, so partial multi-turn work isn't discarded.docs/browser-extension.md— documented Stop vs Pause and what each leaves behind, and rewrote the limitation to say what it means.AGENTS.md— states plainly thatsignalisn't surfaced by the SDK, so plumbing it through is the work required to offer programmatic cancellation.Verified against the code, not recollection
The first draft of the extension section claimed stopping "never leaves the target mid-exchange". That's false:
runners/extension/domTarget.jstests the stop flag after the send and before the extract, so a stop can abandon a message already sent. The text now says so, and notes the turn is dropped rather than recorded half-finished.The Pause/Stop table was checked against
finalizeUserInterruptioninrunners/extension/orchestrator.js— pause persists a snapshot and writes no result (so the in-progress evaluator has no verdict), cancel persists a partial result carryingcancelledJudgment'sCANCELLEDverdict.Also checked, deliberately unchanged
skills/*/report-schema.md— documents the skill's own output shape (totalEvaluators,criticalFindings), notUnifiedRunReport; never covered cost.docs/sdk.md'stotalCostUsd— belongs to the autonomoushuntpipeline, fed by the Agent SDK's own reported cost, untouched by fix: cancellation turn-granularity, extension report gaps, and cache-aware cost pricing #236's pricing change.CHANGELOG.md— release-please generated from conventional commits; hand-editing would be wrong.runners/{cli,sdk,mcp}/README.md,CONTRIBUTING.md— no mentions of cost, tokens, or cancellation.Changes
docs/cli.md— Ctrl+C behaviourdocs/browser-extension.md— Stop/Pause section; limitation rewordedAGENTS.md— SDK cancellation statusDocs only; no source or test changes.
Issue
N/A
How to test
Read the three diffs against the behaviour merged in #236 — specifically
runAttack's per-turn signal check incore/src/execute/attackRunner.ts, andfinalizeUserInterruption/domTarget.js's stop checkpoints inrunners/extension/.npm test(304 pass) andnpm run typecheckare unaffected but were run to confirm nothing regressed.Screenshots
N/A
Summary by CodeRabbit