Repository navigation
Surface budget-gated orchestrator wake-ups instead of stalling silently (#34) - #58
Merged
currentbits merged 1 commit intoAug 15, 2026
Conversation
A worker-finished wake-up rejected by the daily-budget gate only left a quiet event in the transcript: the orchestration stopped advancing and nothing said so. The undeliverable path now records the rejection reason, lands the orchestrator "failed" (sidebar badge + Retry turn), and pushes the change to the renderer. shouldNotify also fires for a thread landing "failed" with no run of its own, so the desktop notification reaches an unattended fan-out. Co-Authored-By: Claude Opus 5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/budget-exhaustion-kills-orchestration-si-2b6a87
branch
October 3, 2026 16:07
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.
Why
When an orchestration worker finished, its wake-up run for the orchestrator went through
startRun, which is gated byassertUnderDailyBudget. If the daily cap had been reached,flushOrchNoticesswallowed the rejection and appended a plaineventmessage to the transcript — no reason, no status change, and not even a renderer push. The orchestration just stopped advancing, and an unattended fan-out looked like it was still working (issue #34).What changed
electron/runner.js— the undeliverable-wake-up path now:Not delivered: Daily budget reached ($X of $Y)…),failed— the existing visible-failure channel:Sidebar.tsx:274renders the Failed badge andretryTurn.ts:65arms the Retry turn button on the last event card,pushDetail+pushThreadsChanged); the old code saved to the store but never pushed, so the event sat unseen until some unrelated refresh.A thread that has a live run racing in after the active-guard keeps its own status — only a genuinely idle orchestrator is marked failed.
electron/notify.js—shouldNotifynow also fires for a thread landingfailedwith no run of its own. The old gate required the previous status to beworking/waiting, so a stalled orchestrator (previouslydone) never got a desktop notification. Threads never seen before (no previous status) stay quiet, so a pre-existing failure does not notify at boot.Scope
The issue also notes there is no per-orchestration or per-thread ceiling for a fan-out, only the global daily cap. That is not in this PR — it needs settings plus per-orchestration accounting and is worth its own change. This PR does the issue's stated minimum: make the gate rejection visible.
Verification
node --test electron/test/runner.test.js— 28/28 pass, including a new test that drives a worker todonewith the cap tripped mid-flight and asserts the orchestrator landsfailedwith the reason in the transcript. It fails on a stashedrunner.js, so it actually covers the fix.node --test electron/test/notify.test.js— 7/7 pass, with a new case for the background-failure transition.npm run typecheck— clean.npm run test:electron— 708/717. The 9 failures are all inorch-server.test.jsand reproduce identically on a clean tree; they are pre-existing and unrelated to this change.PR created by the Claude Code agent