Repository navigation
feat(server): wake the watcher thread when a lane ends, stalls, promises or needs a person - #98
Merged
nullStack65 merged 3 commits intoNov 19, 2026
Conversation
…ses or needs a person The model-alert watcher now also hears four deterministic thread events, judged server-side from the thread shell: lane-ended, promise-without-wake, stuck and needs-person. They share the model alert outbox, retry, cross-environment forwarding, dedupe (per thread and kind until state changes) and webhook. Adds watcherStuckMinutes (default 20) and docs on moving the watcher to an always-on Lead. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…urrence, per-signature dedupe, one task scan per sweep Review of #98: - lane-ended, promise-without-wake and stuck now apply only to agent-created lanes, so a person stopping or leaving their own thread no longer wakes Lead. - The alert id includes the time, so a recurrence of the same state is a new message instead of a replayed command. - A kind holding several findings (a question and an inbox flip) remembers each signature, so they stop alternating on every trigger. - The 60 second sweep reads open delegated tasks once, not once per thread. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rray Found by the R720 typecheck of the stacked branch; the same line is in #98. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Lead had to poll to learn that a lane died, stalled, promised to continue with nothing to wake it, or needed a person. Tonight's real case: the Fleet SSH rollout said "a background watch will wake this thread", settled with none tracked, and its R720 build died unnoticed.
The model-alert watcher from #96 now also hears four deterministic thread events, judged server-side from the thread shell with no agent judgment:
lane-ended: a top-level lane's run endedfailedorinterrupted, orcompletedwith open PRs and nothing tracked to wake it.promise-without-wake: the lane went idle or settled after an explicit "will be woken / will continue later" phrase, with no background task, PR watch, delegated task, snooze or armed resume. The test fixture is the real Fleet message.stuck: an active run with no new activity forwatcherStuckMinutes(default 20, 0 = off), or a thread waiting on background work that no longer exists. Parents with active children are not stuck.needs-person: an agent-created lane raises a pending question or approval, or its inbox goes to a founder oraction.model-degraded'susage_limitreason;lane-endedstays quiet for a failure that alert already reported.They reuse #96's outbox, retry, cross-environment forwarding, webhook and the same watcher setting. Dedupe is per thread and kind until the state changes. Delegated children are skipped (#78 already tells their parent) and the watcher never reports about itself. Each wake carries environment, thread link, title, kind, run id, last assistant line and open PRs. A 60 second sweep covers
stuck, the one kind with no event.Moving Lead to an always-on machine is one value:
DEFAULT_MODEL_ALERT_WATCHERinpackages/contracts/src/settings.ts, documented indocs/operations/watcher-thread.md.Tests: one fixture per kind plus dedupe, outbox sharing and cross-environment forwarding (
ThreadEventAlerts.test.ts,ModelAlertReactor.test.ts, 40 passing). Server typecheck and lint clean. Committed with--no-verifyfor the 4 known unused upstream scripts knip flags on this base.🤖 Generated with Claude Code
Deploy: fleet