Repository navigation
Probe Claude before overnight and send one alert, not one per repo - #269
Merged
Merged
Conversation
On 2026-11-18 every one of the garden's 231 tends failed in under two seconds with "Claude Code can't use your Claude subscription" (billing). That wording was not a device-wide marker, so the batch never aborted and each repo sent its own FAILED alert: 162 reached Discord and 70 were refused with HTTP 429. - Treat the unusable-subscription wording as device-wide, and widen the usage-limit markers (weekly limit, N-hour limit, limit reached) - Before parpt scoring or any tend, make one read-only report-mode probe through run_agent; a device-wide failure skips the night with one SKIPPED alert (--no-preflight turns it off; skipped with routing) - Wait out a usage limit whose reset fits the budget, with one PAUSED alert, before the night and once mid-run, re-dispatching the repos that hit it - Hold back per-repo FAILED alerts for device-wide failures in overnight, and fold the batch summary into the single ABORTED alert Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LYNeumw2Rk1yJYprnsLjvm
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
On 2026-11-18 every one of the garden's 231 tends failed in about 1.7 s, at $0, with "Claude Code can't use your Claude subscription, usually because a payment is past due" (transcript error
oauth_org_not_allowed). That wording wasn't a device-wide marker, so the batch never aborted. Each repo sent its owntend: FAILEDalert: 162 reached Discord and 70 more were refused with HTTP 429.What changes
is_device_global_failure(SUBSCRIPTION_UNAVAILABLE_MARKERS). The usage-limit markers also catchweekly limit,hour limitandlimit reached.gardener/quota.py): before parpt scoring or any tend, one tiny read-only report-mode call goes throughrun_agent. A device-wide failure skips the night with oneSKIPPEDalert, leaving the cursor untouched. A probe that fails for another reason lets the night go ahead. Turned off with--no-preflight; skipped when a routing file is in use and on a non-Claude harness.PAUSEDalert, sleeps until the reset plus 2 min, and probes again. Mid-run, this happens once per night and re-dispatches the repos that hit the limit.overnight, repos that hit a device-wide failure no longer send their own FAILED alert (_quiet_device_global;gardener tendby hand still alerts). The batch summary now goes in the body of the singleABORTEDalert, not as a second message.Tests
tests/test_quota.py: reset-time parsing (bare hour, minutes, named zone, dated, across New Year, epoch form, unreadable), the budget rule, probe classification with an injected runner.TestOvernightUsagePreflightintest_cli.py: the one-alert skip, a flaky probe going ahead, the reset wait and re-probe, a reset too late, routing skipping the probe, one ABORTED alert mid-run, and the mid-run wait re-dispatching the blocked repo.test_cli.pyandtest_routing_wiring.pyfences now patchquota.probeandquota.seconds_to_wait, so no test reachesclaudeor sleeps until a real reset. The existing two-alert assertion was updated to one.PYTHONPATH=. python3.12 -m unittest discover -s testsgives 1498 OK (2 skipped), run with a fakeclaudeon PATH that logged zero calls. Offline integration tier: 79 OK (22 live-tier skips).Not yet done: a manual
overnight --hours 0.1against a real exhausted window. The probe's report-mode call goes through the existingrun_agent/MODE_SPECSpath unchanged.Companion: Stephenson-Software/quartermaster#762.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LYNeumw2Rk1yJYprnsLjvm
drafted by Claude on behalf of Daniel Stephenson