Repository navigation
stewards: treat a worker as in flight between its turns (BB-17) - #35
trotterdylan merged 2 commits into
Conversation
BB-11's steward was woken 22 times in four hours. The mechanical tier suppressed a binding's own pull request activity only while a worker's turn was `running`; in the build-tickets loop the worker is idle most of the time, waiting on its reviewer between rounds, so every push, check run and reviewer comment woke the steward for a "nothing needed doing" turn. - A worker is in flight from its spawn until it is stopped, failed or archived. Its turn ending is a pause: the status `finished` still counts, so own-pull-request activity (checks finishing, description edits, pushes, and comments from the developer's account) stays quiet and is kept as a quiet note for the next due turn. `stopWorkers`, `archiveWaiting` and the thread lifecycle handlers use the same rule, so an idle worker is stopped and archived with its binding like a running one. - The reviewer's `bb-review` markers are the worker's business too, whoever posts them, while a worker is in flight; a round that changes the lane wakes the steward at once. - Compaction now also runs before a wake that would push the transcript over the setting, not only after a turn. The 120,000-token default is unchanged: a wake is capped at 30,000 characters (~7,500 tokens), a steward getting 20 wakes a day adds roughly 150-200k tokens a day, and the pre-wake check bounds any single turn, so a steward compacts once or twice a day and never reads more than the limit. reconcile.test.ts covers the BB-11 sequence at the mechanical tier, and server.test.ts the wake count; unit tests cover the in-flight rule, the reviewer marker and lane change, and the compaction threshold. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Independent review running in bb thread @thread:thr_9a4322ivud. — from bb thread thr_bavqcddfyz |
Review round 1 (GLM 5.3, at 2e02091)Owner review required: no — none of the owner-reviewed triggers apply. The change widens a suppression window that BB-11's incident showed was the bug (the design's "the worker's own work is not news to the steward" was only implemented while a turn ran), stops idle workers with their binding like running ones, and adds a pre-wake compaction check. Suggestions
Checked
— from bb thread thr_9a4322ivud |
- The compactAboveTokens setting description now says compaction also runs before a wake that would push the transcript over it. - compactIfLarge skips a busy thread instead of warn-logging a failed compact on every wake. - DESIGN.md says why a first reviewer marker with no earlier round is not treated as a lane change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Review round 1 follow-ups, at 06f4ef5:
Typecheck and — from bb thread thr_bavqcddfyz |
Review round 2 (GLM 5.3, at 06f4ef5)Owner review required: no — none of the owner-reviewed triggers apply (unchanged from round 1; the follow-ups are a setting-description wording fix, a log-noise fix and a doc paragraph). Resolved since round 1
Checked
— from bb thread thr_9a4322ivud |
|
Merged: no-review lane, reviewer approved 06f4ef5, checks green. — from bb thread thr_bavqcddfyz |
Implements BB-17.
BB-11's steward was woken 22 times in four hours: the mechanical tier suppressed a binding's own PR activity only while a worker's turn was
running, and a worker in the build-tickets loop is idle most of the time waiting on its reviewer. A worker now counts as in flight from its spawn until it is stopped, failed or archived, so its own PR activity is quiet across the idle and kept as quiet notes for the next due turn.Classification
no-review: additive wake suppression plus a threshold tweak. No existing behaviour a person relies on changes meaning, and no cross-repo contract, identity, production infra or store migration is touched.
What changes
workerInFlight/anyWorkerInFlightinreconcile.ts:runningorfinished(a turn ending is a pause, not a finish).diffObservedtakesworkerInFlightand quiets checks, description edits, pushes and developer-account comments while it holds.bb-reviewmarkers are quiet while a worker is in flight, whichever account posts them; a round that changes the lane (markerLaneChange) wakes the steward at once.server.ts:stopWorkers,archiveWaitingand thethread.failed/archived/deletedhandlers use the same in-flight rule, so an idle worker is stopped and archived with its binding like a running one.compactDueand a pre-wakecompactIfLargecall compact when the transcript is over the setting or when the wake about to be sent would push it over. The 120,000-token default is unchanged.DESIGN.md,README.md) updated.The compaction default
Kept at 120,000 tokens. A wake is capped at 30,000 characters (~7,500 tokens at 4 chars/token), and a steward getting 20 wakes a day adds roughly 150,000-200,000 tokens a day including its own turns. At 120k, with the pre-wake check, a steward compacts about once or twice a day and never reads more than the limit into a turn; a lower default would compact on nearly every wake (a provider call each time) and a higher one would let a single turn grow past a quarter of a 1M window. The pre-wake check is what bounds a single large wake, so the default stays where it was.
Testing
npm run typecheckinplugins/stewards: pass.npm testinplugins/stewards: pass (116 tests; not in the CI matrix).reconcile.test.tscovers the BB-11 sequence at the mechanical tier plus the in-flight rule, marker/lane change and compaction threshold;server.test.tscovers the wake count for the BB-11 sequence, the lane-change wake, the stopped-worker case and the pre-wake compaction.🤖 Generated with Claude Code