Repository navigation
fix(bots): stop a running bot reply from the chat - #465
Merged
Merged
Conversation
This was referenced Nov 13, 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.
When a bot is replying, Stop now occupies the send button on web/desktop and mobile, including while the next message is being drafted. It retains the received partial reply with “Stopped by you”, interrupts the worker harness, and accepts the next message immediately.
The RPC and linked-home routing already existed. The web control lived in the header, and mobile hid Stop as soon as the draft contained text. Gateway interruption changed the logical turn without atomically persisting worker cancellation or retaining its streamed text. Worker ACK could precede harness shutdown; Claude's SDK abort returns before process exit, and Grok's ACP cancellation can leave a blocked prompt alive.
Behavior and durability
RunBotTurn/InterruptBotTurnandbot_harness_v1remain the compatibility boundary. No proto, migration or native mobile changes. Stop cannot undo effects completed before cancellation.Mobile coordination: the only shared thread-composer change is an optional
stopWhileRunningprop inComposerBox.tsx, defaulting to false. Bot composer wiring opts in; the thread composer keeps its existing behavior. Please preserve this prop when combining the separate mobile thread-composer work.Validation
bots-stop.test.ts: 6 pass covering Claude/Codex/Grok, process exit, immediate next input, queued input, late replay, owner scoping, offline cancellation and gateway/worker restart.bots-harness.test.ts: 24 pass; Claude round-trip/approval tests rerun after the process teardown change: 2 pass.bot-adapters-stop.test.ts: 3 pass with blocked fake CLIs, process exit before resolution and already-aborted admission. Worker journal tests: 10 pass, including cancellation before admission across reopen.bun install,bun run typecheck,bun run lint,bun run format:check,bun run gen:check, andbun run --filter @canopy/web buildpassed. Full localcheck:tmpintentionally omitted per task; CI is the full-suite gate.Production fingerprints generated using
bunx [email protected] fingerprint:generate --platform <ios|android> --build-profile production --json --non-interactivematch current dev (9355f128) exactly:6ddec9ef559ee0095ac33e94ff9418a942053b175f6eae3ab278f1cd543e9ed763f923a319b65ec9Copy audit — docs/copy.md §8
Audit passed: sentence case, concise existing glossary terms, no new jargon, no repeated status fact or new empty state, no decorative sentences. Labels are available to assistive technology and through the existing tooltip/control text. Short, typical and long names were checked at desktop and phone widths.
Related: #97
Related: #104