Repository navigation
Stop the runaway scan from telling Captains to rotate crew threads that hold a PR (GST-2226) - #4250
Merged
Merged
Conversation
|
😎 This pull request was merged. |
…at hold a PR (GST-2226) Only a thread marked standing rotates, and never while it holds an open PR or its PR list is missing; a crew thread gets one CHECK_IN past 1B own tokens (R70 as amended, R91). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…with #4244 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
garrytan
force-pushed
the
capy/stop-the-runaway-scan
branch
from
November 9, 2026 21:51
a491521 to
62f4ea7
Compare
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Merged
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.
gstack-runaway scanno longer tells you to rotate or warn about an agent thread that still has an open pull request. Only threads marked as long-running get rotation advice, and only after every pull request they hold is merged or closed.What changed
ROTATEand no own-tokenWARN. Past 1 billion own tokens they get oneFLAG: CHECK_INline, and they keep their PR.FLAG: ROTATEat 500M own tokens or 3 active days, with the 400M warn line.DEFER: holds an open PR; rotate after every PR merges or closes (R91)instead ofROTATE. A file whosepull_requestslist is missing or shorter thanpull_requests_totalcounts as holding one.SWEEP:gains acheck_in=count. /runaway-stopper's fetch program gets astandinglist, its line table gets aCHECK_INrow, and--helpand docs/skills.md say the same. The skill stays inside its 3,841-token context budget.Why
The scan was pointing Captains at rotating crew threads that still held unmerged PRs, which the archive rules forbid. This keeps the factory's own tooling in line with those rules.
Blast radius
The change is limited to the scan's printed advice in lib/runaway.ts and the /runaway-stopper skill text. The scan never acts on its own, and archive-check (#4244) still refuses to archive a thread with an open PR.
Documentation
Status: current. No documentation edits were needed, and there are no blockers.
Scope: base 83bfdc5 to head 431253f (3 commits, 6 files: lib/runaway.ts, test/runaway.test.ts, runaway-stopper/SKILL.md.tmpl and its generated SKILL.md, docs/skills.md and one changelog.d fragment). The working tree has no staged, unstaged or new files.
Documentation health:
Coverage debt: the new
FLAG: CHECK_INline and theDEFER: holds an open PRline are explained in the skill's line table and in docs/skills.md, but docs/troubleshooting.md has no entry for either. That's a common gap. Diagram drift: none, because no diagram names the changed modules.Issues
Refs #4244
Test plan
bun test test/runaway.test.tscovers crew, standing, open, draft, unlisted and unknown PR cases.Deferred findings
Blocking findings in code this PR did not change (review scope: frozen). They stay on this PR and are not filed as issues.
runaway-stopper/SKILL.md.tmpl:30The automation run messages the Captain on ROTATE, STOP, REPORT or RUNAWAY_INPUT, not CHECK_IN.Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
runaway-stopper/SKILL.md.tmpl:42The fetch program's standing list defaults to empty, so a forgotten standing thread gets no ROTATE/WARN until CHECK_IN past 1B.lib/runaway.ts:190A WARN or STOP verdict outranks a hold, so SWEEP defer= undercounts held rotations (the DEFER line still prints).runaway-stopper/SKILL.md.tmpl:42The default standing list is empty, so nothing rotates unless the Captain fills it in.runaway-stopper/SKILL.md.tmpl:78CHECK_IN repeats on every sweep; the scan keeps no state.lib/runaway.ts:158A missing pull_requests_total counts as a complete list (same root as outside-voice#1).test/runaway.test.ts:1The draft-PR test case goes down the unlisted path, so it does not prove a draft PR blocks rotation.Agent notes
pull_requests_totalcase is a follow-up the Captain is queuing.Agent notes