Skip to content

Commit 2ec02bc

Browse files
committed
Align interrupt and fleet docs with shipped behavior
Ctrl+C JSDoc still said the path cleared pending items after the implementation started keeping them. The fleet-report section credited the 400ms settle timer with quiet detection and named /fleet; quiet is polled on the 5s stall interval, settle only coalesces burst store changes, and the command is /status. Kept-queue drain is at the interrupt itself, not a later boundary via applyShellInterrupt.
1 parent 03c5ec2 commit 2ec02bc

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

docs/TUI.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,11 @@ stalled, only about *when* they say so: the panel shows it continuously,
278278
the notice announces the transition once.
279279

280280
Store changes drive it directly, so a lane finishing or failing lands the
281-
moment it happens; a `FLEET_REPORT_SETTLE_MS` (400ms) timer covers the one
282-
change that produces no event at all — a lane going quiet — and also lets a
283-
parallel dispatch that lands as N store changes settle into one observation
284-
instead of N lines. Past `COALESCE_ABOVE` (3) changes in one observation the
281+
moment it happens. A `FLEET_REPORT_SETTLE_MS` (400ms) timer lets a parallel
282+
dispatch that lands as N store changes settle into one observation instead
283+
of N lines. Quiet detection is separate: `FLEET_STALL_POLL_MS` (5s) re-runs
284+
observation so a lane that went quiet with no further store event is still
285+
announced once. Past `COALESCE_ABOVE` (3) changes in one observation the
285286
individual lines collapse into a single tally (`"9 done, 3 failed"`); below
286287
that threshold each change gets its own line. The one case both the fleet
287288
going idle and a coalesced tally would otherwise say the same thing —
@@ -292,7 +293,7 @@ failed" — the idle line replaces the tally instead of repeating it with
292293
Outcomes and errors are clipped to `OUTCOME_CHARS`/`MAX_UPDATE_CHARS` on the
293294
same "one update is one row, never wrapped" rule the panel's rows follow.
294295
`fleetDigest()` is the on-demand counterpart: the same picture in one line,
295-
answering "where is the fleet" without an interrupt, for `/fleet` or an
296+
answering "where is the fleet" without an interrupt, for `/status` or an
296297
operator question mid-run.
297298

298299
## How pop-ups should feel
@@ -481,8 +482,10 @@ explicit second confirmation) without adding a modal (`handleCtrlC`,
481482
`shell.ts`). The interrupt keeps whatever is sitting in the queue rather than
482483
discarding it — the operator typed those messages meaning them delivered, not
483484
meaning "cancel this run and also throw away what I typed"; the transcript
484-
row says so (`"interrupt — N pending kept"`) and the kept items drain into the
485-
rebuilt agent at the next boundary (`applyShellInterrupt`, `shell.ts`).
485+
row says so (`"interrupt — N pending kept"`). Kept items are handed over at
486+
the interrupt itself (`doInterrupt` in `runtime-bridge.ts` drains after
487+
`port.interrupt()`), serialized behind the agent rebuild the stop starts —
488+
a stop does not reliably produce an idle event to drain against later.
486489

487490
## Overflows, scrolling, and key macros
488491

src/tui-opentui/shell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3180,7 +3180,7 @@ export function applyShellInterrupt(shell: AppShell): void {
31803180
paintChrome(shell)
31813181
}
31823182

3183-
/** Ctrl+C interrupt path: clear pending, flash, idle. */
3183+
/** Ctrl+C interrupt path: keep pending, flash, idle. */
31843184
export function interruptShell(shell: AppShell): void {
31853185
const hooks = getShellBridgeHooks(shell)
31863186
if (hooks?.exclusive) {

0 commit comments

Comments
 (0)