A routine's Run now is not held back by the sweep's cooldown (#1642) - #1645
Merged
Conversation
After any run on a project, the sweep's 30-minute cooldown stood every later pass down with "a run was started for this project a moment ago". Since #1210 a Run now is a sweep, so for half an hour the button could start nothing — the stand-down is reported in small text under the fold of the card, after the click, while the button stays enabled and its tooltip still promises agents. Restarting the daemon cleared it, which is how the #1640 dogfood got past it. The cooldown paces work nobody asked for. A click is someone asking, the same reading that already lets an on-demand sweep outrank the master switch. So `autoPmDecision` takes `onDemand` and skips the cooldown for it; the sweep passes the flag through. The concurrency cap is deliberately not waived with it. The #685 test names the cooldown as what stops a tick landing before the spawn registers from doubling up; for a click that guard is the cap alone, which holds because `start()` resolves after the spawn and ticks are serialized, so a second click counts the first. The new decision test pins both halves. `auto-pm.SPEC.md` said Run now skips only the master switch; it now names the cooldown too, and why. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
🤖 automated Dogfooded on |
This was referenced Aug 22, 2026
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.
🤖 automated
Fixes #1642 — option A.
What changed.
autoPmDecisiontakesonDemand, and skips the 30-minute cooldown when it is set. The sweep passes the flag through fromtick({ onDemand }). One condition, one flag, no new state.Why A. The cooldown paces work nobody asked for. A click is someone asking — the same reading that already lets an on-demand sweep outrank the master switch (
auto-pm.tstickdoc, #1210). Before this, a Run now fired within half an hour of any run on that project stood down with "a run was started for this project a moment ago" — reported in small grey text under the fold of the card, after the click, while the button stayed enabled and its tooltip still promised agents. The only way past it was restarting the daemon.What is deliberately not waived: the concurrency cap. The #685 double-tick test names the cooldown as what stops a tick that lands before the spawn registers from doubling up. For a click that guard is the cap alone, and it holds:
start()resolves after the spawn, ticks are serialized bysweeping, so a second click counts the first agent. The new decision test pins both halves — through the cooldown when asked, still refused at the cap.Spec.
auto-pm.SPEC.mdsaid "Run now skips only the master switch". It now says it skips the master switch and the cooldown, and why the cap stays.Verified.
auto-pm.test: 91/91. With the bypass removed from the gate, exactly the two #1642 tests fail and nothing else; restored, green.tsc --noEmitclean.Independent of #1640 (different lines of
auto-pm.ts; branched frommain).