You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tui): bound the primary turn so a silent stall can't freeze it (#1080)
* fix(tui): bound the primary turn so a silent stall can't freeze it
* fix(tui): answer CL-8016 critic nits without changing stall-bound behavior
Summary: document turnMarkers as diagnostic-only; drive the stop test through production cancelWorkersForStop; import prod ASK_DEADLINE_MS and pin its value and 2x stall-bound sizing; coalesce expireStaleAsks to one notify per batch; drop dead ?. on FleetMailbox.sessions.
Verification: bun run typecheck (exit 0); oxfmt --check and oxlint clean on all five files; bun test --randomize green on wiring.stall-bound (4 pass) plus session-store, agent-fleet, wiring.stall-poll, wiring.ask-wake, ask-director (207 pass, 0 fail).
* fix(tui): hang stalled ask-wake resurface on shouldAbortForStall
After the silent-turn abort, a second wake-only predicate would duplicate
that bound. Un-dedupe armed wakes on interrupt instead.
* fix(tui): let occupancy win after a stalled ask-wake abort
A stalled armed wake was re-surfacing before mailbox mail, so
occupancy lost the next turn. Share one interrupt path: interrupt
the hung inference, then mail, then wake only if still idle.
Expiring asks must abort that wake, not merely disarm it.
`${ASK_DIRECTOR_WAKE_PREFIX} — worker ${wake.agentId} (${wake.description}) parked question ${wake.questionId} while this session was not collecting:`,
180
183
"",
181
184
wake.question,
182
185
"",
186
+
];
187
+
// Escalation for a re-surfaced question (CL-8016): the earlier wake turn
188
+
// stalled past the bound and was aborted without an answer, so say so and
189
+
// restate the routing — otherwise a second identical wake reads as a
190
+
// duplicate rather than as proof the first one never landed.
`Re-surface ${options.resurface}: the earlier wake turn stalled and was aborted without an answer — reconcile against the live question before replying.`,
194
+
"",
195
+
);
196
+
}
197
+
lines.push(
183
198
`The worker — not the operator — raised this. Answer it with send_input (soft) using target ${wake.sessionId}; do not relay to the operator unless it genuinely needs them.`,
`ask_director question ${pending.questionId} for session ${id} expired without an answer after ${maxAgeMs}ms — reply with send_input before the deadline, or not at all`,
1940
+
true,
1941
+
);
1942
+
}
1943
+
// One subscriber wake for the batch (none when nothing expired):
1944
+
// per-ask notifies would wake N observers for one poll tick.
0 commit comments