Repository navigation
Merge queue ready fetches missing pull request heads in one go, says so, and stops after 60 seconds (GST-3460) - #4668
Merged
Conversation
…so, and stops after 60 seconds (GST-3460) On gbrain #10011 ready printed nothing for minutes: its trial merges fetched each missing sibling head on its own, one after another, with 120 s allowed per fetch. Ready now fetches them in one git fetch (falling back to one at a time within the same limit), prints a progress line first, and refuses with the refs it was waiting on when the limit runs out. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…t head when the combined fetch fails (GST-3460) Review-Finding: p1/specialist-batched#1 reader=testing Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… refusal (GST-3460) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Merged
3 tasks done
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-ship-queue readyno longer goes silent for minutes on a long merge queue: it fetches every missing pull request head in onegit fetch, prints a progress line first, and stops after 60 seconds.Why: on gbrain #10011 ready printed nothing for minutes, so nobody could tell a slow fetch from a hang.
Nothing to do;
GSTACK_TRIAL_FETCH_TIMEOUT_MSchanges the limit.What was happening
A trace of the stuck run showed one pass, not a loop. Ready checks the PR against every open PR that touches the same files by merging the two heads in memory. Any head missing from the clone was fetched with its own
git fetch origin refs/pull/<n>/head, one at a time, and each fetch could take up to 120 s. Ready prints its whole report at the end, so nothing appeared until every fetch was done. The trace ended insidegit fetch origin refs/pull/9946/head, 26 s into that one fetch.What changed
Ready's trial merges against other open pull requests used to fetch each missing head on its own, one after another, allowing 120 s per fetch, and said nothing until the end. Now the missing heads come down in one
git fetch(one at a time only if that fails), all inside one 60 s limit, and ready prints a line to stderr before it starts:When the limit runs out, ready refuses with
QUEUE_NOT_READYand names eachrefs/pull/<n>/headit was waiting on, instead of printing READY with that trial merge missing.Tests
bun test test/ship-queue-trial-fetch.test.ts test/ship-queue-ready-tail.test.ts test/ship-queue-ready-fresh-base.test.ts test/gstack-ship-queue.test.ts: 40 pass, 0 failbun run test: carried from CI run 44989710296 at this tree (38,819 tests)Why
"ready printed nothing for minutes" (gbrain #10011). The wait is now bounded and announced, and a fetch that cannot finish stops ready instead of slipping through.
Blast radius
Only
ready(and the batched landing path, which callsready()) runs the trial merges;git()in crew/lib/ship-queue-gate.ts gains an optional timeout whose default stays 120 s, so its other callers are unchanged (file:line read). The new stderr line cannot break a caller, because nothing parses ready's stderr (read across the source tree by the reviewers).Test Coverage
Tests: 1863 → 1864 (+1 new). The new file test/ship-queue-trial-fetch.test.ts has 4 cases: one combined fetch for twelve missing heads with the progress line first; a fast-failing combined fetch falling back to one fetch per ref and still trial-merging the rest; a stalled fetch stopping at the limit; and ready refusing
QUEUE_NOT_READYnaming the ref. Left untested: the fallback loop running out of time partway through.Tests ran: focused 40
Pre-Landing Review
One full review pass (testing, security and state-machine checklists, red team), one follow-up read of the fix, a Claude adversarial pass and a second-model review (GPT-6.2 Sol). Pass 1 found one test gap (the fallback path), fixed in 51cac14; the follow-up read found nothing. The second-model review raised two findings it marked blocking: presence checks can fetch lazily on a partial clone outside the 60 s limit, and ready finds a stall by matching a sentence in its own output. The maintainer accepted both as open notes (see Agent notes): the first is unchanged old behaviour, and the second can only cause a refusal, never a wrong READY.
Review notes
Below the blocking floor; recorded here and not fixed in this PR.
GSTACK_TRIAL_FETCH_TIMEOUT_MSmakesspawnSyncthrow instead of giving a coded refusal (lib/ship-queue.ts:315).git fetch's transport child processes are not killed; Bun'sspawnSyncstill returns at the limit (crew/lib/ship-queue-gate.ts:51).Exploratory QA
Functional smoke, report-only, on owned fixture repositories: the combined fetch, stall and refusal cases passed (
bun test test/ship-queue-trial-fetch.test.ts, 3 of 3), and a probe with one sibling ref missing from origin showed the fallback recovering the other three heads (5 fetches, plain MISSING line, no stall). One probe was a test-runner selector error and was rerun. Revalidated after the fix: 4 of 4 pass. Not probed: the fallback running out of time partway through.Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Review bot comments
Review bot triage: not run in this /ship invocation.
Issues
Refs #10011
Refs p1/specialist-batched#1
TODOS
No TODO items completed in this PR.
Documentation
Scope: This audit covers the trial-merge fetch change on tree 43511a407711020f5a2d7d76756e2ebce178a530, run in ship-owned edit mode (Steps 1, 1.5, 2-4 and 6 only). I reviewed changelog.d/ready-finishes-fast-on-a-long-queue.md, crew/lib/ship-queue-gate.ts, lib/ship-queue.ts, scripts/lib/windows-curation.ts, test/ship-queue-trial-fetch.test.ts, docs/unattended.md, docs/troubleshooting.md and docs/ship-policy.md.
Result: I updated two docs and left the edits uncommitted.
GSTACK_TRIAL_FETCH_TIMEOUT_MS. ready prints a progress line first and refuses withQUEUE_NOT_READYwhen the limit runs out.QUEUE_NOT_READYentry now lists the fetch timeout as a cause and gives its fix.No templates or generated files changed, so nothing needs regenerating. The banned-terms check reported none (the repo has no .gstack/banned-terms.json).
Debt: There are no blockers and no documentation debt. Steps 5, 7, 8 and 9 and the cross-model review did not run in this mode.
Agent notes
Refs GST-3460
Approvals
Approved: yes (record r-2394f2c69602). The full approval record stays private.
Plan: exempt: bug fix (R65)
Plan check: exempt bug fix
REVIEW_LOOP: passes=1 blocking_found=2 deferred=0 noted=4 fixed=1 scope=frozen open=2 unbound=2 ledgers_read=4 fix_checks=1 dispatches=4
Gate edits: none detected (1 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Ruled note: lib/ship-queue.ts:314:performance at 51cac14 ruled by Captain GStack Minder (GSTA-36) (relayed from GSTA-36:2026-11-22T05:40:00Z) at 2026-11-22T05:31:42.894Z: Both are below the floor: lazy fetch on partial clones is unchanged old behaviour, and the sentence match can only cause a refusal, never a wrong READY. (approval a-f9a6d0e6f9a8)
Ruled note: lib/ship-queue.ts:411:correctness at 51cac14 ruled by Captain GStack Minder (GSTA-36) (relayed from GSTA-36:2026-11-22T05:40:00Z) at 2026-11-22T05:31:43.094Z: Both are below the floor: lazy fetch on partial clones is unchanged old behaviour, and the sentence match can only cause a refusal, never a wrong READY. (approval a-084558292e57)
🤖 Generated with Claude Code