Show a stopping state on the composer once an interrupt is accepted - #447
Merged
Merged
Conversation
Claude Code only acts on an interrupt control request after its session init (MCP servers, hooks, context assembly) finishes, while tcode marks the turn running the moment the prompt hits stdin. Clicking Stop right after sending therefore looked ignored for 0.5–6 s with no feedback. The host now records interrupt_requested on the resident when the interrupt reaches the provider channel, clears it on TurnCompleted and provider teardown, and publishes it as SessionStatus.stopping. Both Stop buttons dim while it is set. The runtime test covers the set/clear cycle. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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.
Behaviour
Clicking Stop right after sending the first message of a Claude Code thread looked ignored for 0.5–6 s, then the turn ended as interrupted. Measured against the CLI directly (same launch flags tcode uses): an
interruptcontrol request is executed within 3–20 ms during streaming, first-byte wait, hanging connects and retry backoff, but is only acknowledged and deferred untilsystem/initand query setup finish (MCP servers, hooks, context assembly). tcode marks the turn running the moment the prompt hits stdin, so the Stop button appears before the CLI can honour it, and nothing changed on click untilTurnCompleted.The host now records
interrupt_requestedon the resident when the interrupt reaches the provider channel, clears it onTurnCompleted,shutdown_to_idleandmark_dead, and publishes it asSessionStatus.stopping(serde(default), so older remote clients keep working). Both composer Stop buttons dim while it is set; clicks remain allowed because a repeated interrupt is harmless.No new abstractions: one boolean on the existing resident, one field on the existing status snapshot, and the existing
DomainDiffpushes it to clients.Tests
interrupt_reports_stopping_until_the_turn_completes(runtime) protects the contract:interrupt()setsstoppingin the snapshot,TurnCompletedclears bothstoppingandturn_running.Checks run locally (macOS)
cargo fmt --all --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo build --workspace --lockedcargo test --workspace --lockedNot run locally:
cargo machete, iOS/Android/Web targets, Windows/Linux — left to CI.Co-authored-by: Claude Fable 5.1 noreply@anthropic.com