fix(daemon): a person's turn stays held for its Stop when the bridge's waiter expires mid-turn #4185
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 437 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.364
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #4185"
general
weight: 0.35
mvschwarz
What a user gets
On a Claude seat that opted in to the hook bridge, a message waiting while the person's turn runs is delivered at the turn's end through the bridge, even when the bridge's waiter reaches its own deadline mid-turn. Before, the expiry handed it to typing into the running turn.
What changed
HookBridge.live()stays true for a person's turn after its waiter expires, when three things hold:- UserPromptSubmit recorded the turn before the waiter expired;
- the seat is opted in;
- its waiter had armed.
The turn's Stop then arms a new waiter, which delivers at the boundary.
- a waiter that expires while the seat is idle, or before a turn began, is typed after the 20 s live bound;
- stale and never-armed waiters, opted-out seats, another occupant's messages, ordering, the typing guard and effect reconciliation.
docs/reference/seat-delivery.mdstates both cases and the cost.Timing (a person's turn; its waiter expires mid-turn)
| | Before | After |
|---|---|---|
| The turn's Stop arrives | typed into the running turn at the next 5 s sweep, once the message has waited 20 s (within seconds of the expiry for one queued earlier) | delivered by the new waiter at the Stop; nothing typed |
| No Stop | the same | typed at the turn's start + 15 min |
The cost: an opted-in seat whose Stop hook stops reporting can get a message up to the rest of the turn's 15 minutes later than before.
Tests
hook-bridge.test.ts:- the hold, through to the Stop's delivery;
- the missing-Stop path, typed exactly at the turn's start + 15 min;
- a turn begun after the expiry, and an opted-out seat, aren't held.
session-transport-hook-bridge.test.ts: the pending-at-expiry case is split in two.- An idle seat's expiry: typed after the live bound, under the typing guard, with the expiry as its reason, as before.
- A person's turn: held for the Stop. A new send during the turn is bridged, nothing is typed, and with no Stop it's typed at the bound.
- A preference-switch test no longer starts an incidental turn.
npm run test:repo.Not covered
A dialog that opens between a typed message's last input check and its Enter. This change only stops this path typing into a held person's turn.
Refs #3270
🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Messages queued during a person’s turn remain queued after the delivery waiter expires. A Stop can re-arm delivery; otherwise, messages fall back to typing at the turn’s original 15-minute deadline.
A new prompt can end the wait sooner and start typed fallback. Turns that begin at or after waiter expiry retain the existing fallback behavior.
If the waiter expires while idle or before a turn, queued messages retain the 20-second typed fallback.
Documentation
Clarified message delivery behavior when the waiter expires during or around a turn.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->