Skip to content

Show a stopping state on the composer once an interrupt is accepted - #447

Merged
Tryanks merged 1 commit into
mainfrom
fix/stop-feedback
Sep 16, 2026
Merged

Tryanks merged 1 commit into
mainfrom
fix/stop-feedback

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 16, 2026

Copy link
Copy Markdown
Owner

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 interrupt control request is executed within 3–20 ms during streaming, first-byte wait, hanging connects and retry backoff, but is only acknowledged and deferred until system/init and 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 until TurnCompleted.

The host now records interrupt_requested on the resident when the interrupt reaches the provider channel, clears it on TurnCompleted, shutdown_to_idle and mark_dead, and publishes it as SessionStatus.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 DomainDiff pushes it to clients.

Tests

interrupt_reports_stopping_until_the_turn_completes (runtime) protects the contract: interrupt() sets stopping in the snapshot, TurnCompleted clears both stopping and turn_running.

Checks run locally (macOS)

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo build --workspace --locked
  • cargo test --workspace --locked

Not run locally: cargo machete, iOS/Android/Web targets, Windows/Linux — left to CI.

Co-authored-by: Claude Fable 5.1 noreply@anthropic.com

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>
@Tryanks
Tryanks enabled auto-merge (squash) September 16, 2026 08:45
@Tryanks
Tryanks merged commit 4ae1c42 into main Sep 16, 2026
6 checks passed
@Tryanks
Tryanks deleted the fix/stop-feedback branch September 16, 2026 08:57
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.

1 participant