Repository navigation
Start a busy run only from input or an OSC 9;4 report, so a repaint after a click never rings - #1222
Merged
Merged
Conversation
…never work A click into an idle Claude Code pane sends a focus report; Claude repaints text, the detector called it work, and leaving the pane rang a false "claude went quiet". A busy run now has to begin within cfg.alert.workStartWindow of a write that is not a terminal reply or mouse report, which also replaces the resize grace window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ress start work /simplify pass: the host and the fake adapter shared a two-step input prologue; it is now one call. An active OSC 9;4 report opens the work-start window like input, so a turn Claude starts unasked still reads as busy and still defers an owed ring. Classification skips writes already marked as human input and returns early when a write doesn't start with ESC. Tests use shared press/work helpers, and the dead resize setup is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
51c38e3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c02dcf93.mouseterm.pages.dev |
| Branch Preview URL: | https://alert-input-gate.mouseterm.pages.dev |
nedtwigg
had a problem deploying
to
hosted-preview
October 20, 2026 05:50 — with
GitHub Actions
Error
dormouse-bot
left a comment
Collaborator
There was a problem hiding this comment.
One thing to decide before this merges, inline on the gate: output that resumes after a mid-run settle is now ignored once it falls outside the work-start window.
Separately, a one-line leftover outside the diff: the alertedPtys doc comment in vscode-ext/src/message-router.ts still reads "Every PTY write and resize, as the alerts must see it." alertedPty no longer handles resizes.
…the mid-run settle trade-off The alert-program tests fed the tutorial shell directly, so no input reached the alert host and the agent's turn never read as busy; they now write through FakePtyAdapter.writePty as the playground does. Output resuming after a mid-run settle with no input or progress report inside the window is ignored like any other; the rationale says so and why an owed ring does not reopen the gate. The vscode alertedPtys comment no longer mentions resizes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dormouse-bot
previously approved these changes
Oct 20, 2026
Scrolling Claude Code's transcript sends wheel reports, and the program repaints for as long as the scroll lasts. As a mouse-only chunk the scroll acknowledged nothing, so reading a finished turn never answered its ring. A wheel tick is now user input like a keystroke: it acknowledges, opens the echo window so the repaint is ignored while the scroll lasts, and lets work start. Hover, drag-motion, and button reports stay passive, a click acknowledging through the Pane's DOM handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… nothing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dormouse-bot
left a comment
Collaborator
There was a problem hiding this comment.
The wheel-as-input commit gives a scroll the same false-ring path a click had, and it also changes what a scroll does to a selection. Details inline.
dormouse-bot
dismissed
their stale review
October 21, 2026 01:02
Superseded by the review on a later commit.
… ending a selection Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dormouse-bot
approved these changes
Oct 21, 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.
Clicking into an idle Claude Code pane rang a false "claude went quiet" once you left. The click sends a focus report (
ESC[I), and Claude answers by repainting real text. In one report the repaint began 1.4 s after the click and lasted 1.8 s. The output/silence detector read that as work, so when the user moved away the settle rang. Two diagnostic reports (2026-10-19, surface:12 and surface:42) show the same sequence: click, repaint, leave, ring.The rule: a busy run must begin within
cfg.alert.workStartWindow(5 s) of either:dor sendand launches;OSC 9;4report, so a turn Claude starts by itself (a background task waking it,/loop) still reads as busy and still defers a ring it owes.Output that would start a run later is ignored entirely, the way echo is: a repaint on focus or resize, or a status-line tick. Once a run has begun, all of its output counts until it settles.
AlertManager.onWrite(id, data, { userInput })hears every PTY write before it reaches the PTY: it acknowledges human input and opens the work-start window.alertedPty.write(both hosts and Pocket's Burrow path) andFakePtyAdapter.writePtycall it instead of their copied prologues.inputCanStartWorkinterminal-report-filter.tsreads a chunk the way the renderer's input branch does. It returns early on a write that doesn't start with ESC, so a large paste never goes through the regexes.QuiesceDetector.onResize,AlertManager.onResize,alertedPty.resizeandcfg.alert.resizeDebounceare gone, and the hosts resize the PTY directly.stripPassiveMouseReportsFromInputinterminal-report-filter.tsdraws the line, andinputCanStartWorktakesuserInputso that a human's reply-shaped key (Shift+F3) still starts work while a wheel tick doesn't.docs/specs/alert.md→ WATCHING Track states the rule. The rationale records the reports and the cost.Behavior changes:
--until quietgrace window. So a repaint after a click doesn't turn a stale idle ping into a fresh ring, and an await on an idle Session resolvesidleinstead of being kept parked by a repaint.claude,codex,pi) starts output at once.OSC 9;4report inside the window, is ignored too. An owed ring stays up through it, and a later await resolves on that ring. Letting an owed ring reopen the gate would bring back a resize or status-line repaint hiding a ring that is already showing. The default agents keep a spinner going through a turn, so they never settle mid-run.Tests:
alertedPty:dor sendfollowed by work rings;userInputwrite that looks like a reply (Shift+F3,ESC[1;2R) still starts work;inputCanStartWorkunit cases.press/workhelpers inalert-manager-test-utils.ts. The website's alert-program tests type throughFakePtyAdapter.writePty, the way the playground does.Verified locally:
tsc -b.🤖 Generated with Claude Code