Repository navigation
Large repos can raise the review-plan time limit for every /ship step (GST-3398) - #4632
Merged
Merged
Conversation
…ep (GST-3398) gstack-review-dispatch render and gstack-ship-preflight ran gstack-review-plan under a fixed 180 s while the plan and the pass read GSTACK_REVIEW_PLAN_TIMEOUT_MS; every caller now reads it through reviewPlanTimeoutMs. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was 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_REVIEW_PLAN_TIMEOUT_MSnow raises the review-plan time limit in every place /ship runs the plan, not just two of them.Why: on a 301,669-file repository the plan takes 255 to 316 s on a 2-core machine; the plan and the review pass read the variable, but render and preflight still cut it off at 180 s.
Nothing to do unless your repository is large; then set the variable (docs/troubleshooting.md#review-plan-stopped).
What changed
With GSTACK_REVIEW_PLAN_TIMEOUT_MS=1, render used to ignore the limit and finish; now it stops at the limit like the review pass does.
Before/after as text: With GSTACK_REVIEW_PLAN_TIMEOUT_MS=1, render used to ignore the limit and finish; now it stops at the limit like the review pass does
A large repository that raised the limit still had /ship cut off at 180 seconds, because
gstack-review-dispatch render(which runs the plan when the base policy hasreview_exclude_paths) andgstack-ship-preflightpassed a fixed 180,000 ms togstack-review-plan. Both now read the limit throughreviewPlanTimeoutMs()inlib/review-collect.ts, the parser the plan andgstack-review-dispatch passalready used. A whole number of at least 1 ms sets it, a fraction rounds down, and an empty, zero, negative or non-numeric value keeps 180,000 ms. Render and pass now share one plan runner, so a render that runs out of time prints the sameREVIEW_PLAN_STOPPEDline instead ofexited SIGTERM. docs/troubleshooting.md documents the variable and which commands read it.Why
harness-evals#548 stopped twice at
timeout_ms=180000even though the variable was set. Large repositories can now raise one limit and have every /ship step honor it.Blast radius
Only the two callers that launch
gstack-review-planchange, and the default stays 180 s, so repositories that never set the variable behave exactly as before. A whole-tree read found no other hard-coded plan timeout (bin/gstack-review-dispatch and lib/ship-preflight.ts read; render and preflight walked at limits of 1 ms, 600,000 ms and unset in a fixture repository).Test Coverage
All new code paths have test coverage. One path is weakly covered: preflight's use of the shared limit has only a source check; a fixture probe in Exploratory QA exercised it.
Tests: 1851 → 1851 (+0 new; the PR's own tests were written before this run)
Coverage: 83% value-weighted (100% including 1 weakly covered path)
Test value: 0 tests written, 0 rejected by the authoring gate, 0 existing tests extended, 1 path weakly covered (weak = ★, gate-failing or unrated).
Tests ran: targeted 34
Tests ran: test 1732
Pre-Landing Review
No blocking issues. Four review passes (a batched specialist read, a red-team read, a native adversarial read and a second-model review) found three items below the blocking floor, listed under Review notes; none was fixed in this PR. The second-model review returned clean.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
sf-6650a61b0584security finding, details recorded privatelylib/ship-preflight.ts:195Preflight runs gstack-review-plan without GSTACK_REVIEW_PLAN_BOUNDED=1 under the same limit as the plan's own wrapper, so on timeout the wrapper is killed and the inner plan keeps running; RUNTIME_LINES prints unknown with no stop line. Same behaviour on main.lib/review-collect.ts:152reviewPlanTimeoutMs accepts values of 2^31 ms or more, which Bun's spawnSync wraps to a short timeout.Exploratory QA
Functional smoke on an owned two-commit fixture repository, 5 probes, all pass: render finishes with the variable unset; stops with
REVIEW_PLAN_STOPPED timeout_ms=1and writes no diff at 1 ms; finishes at 600,000 ms; preflight printsRUNTIME_LINES: unknownat 1 ms and a count when unset. Not measured: plan speed on a large repository.Eval Results
No prompt-related files changed — evals skipped.
Review bot comments
No review bot comments.
Scope Drift
Scope Check: CLEAN
Intent: make render and preflight honor GSTACK_REVIEW_PLAN_TIMEOUT_MS like the plan and pass do.
Delivered: both callers read the shared parser, render prints the shared stop line, with tests and docs.
Verification Results
No plan verification items (bug fix, no plan file).
TODOS
No TODO items completed in this PR.
Documentation
Status: current. Documentation already matches this change, so no edits were needed.
Scope: commit 24fe6ae against base 6263e0e (8 files: bin/gstack-review-dispatch, lib/review-collect.ts, lib/ship-preflight.ts, two docs, one changelog fragment, two tests). Nothing was staged, unstaged or untracked.
Documentation health
REVIEW_PLAN_STOPPEDentry covers render and preflight, the variable's parsing (checked againstreviewPlanTimeoutMs) and guidance for large repositories.renderbesidepass.Coverage debt:
GSTACK_REVIEW_PLAN_TIMEOUT_MShas reference and how-to docs in troubleshooting.md but no tutorial (minor). No critical gaps.Diagram drift: none.
Tests
bun test test/review-dispatch-plan-timeout.test.ts test/review-collect.test.ts: 34 passbun run test: carried from CI run 44951373692 (1732 files, green)Agent notes
Issue GST-3398, from HARN-108 via HARN-1 (harness-evals#548 stopped twice at
timeout_ms=180000). Whole-tree grep for the limit: the only hard-coded plan timeouts were bin/gstack-review-dispatch:363 (render) and lib/ship-preflight.ts:194; the other 180_000 literals bound unrelated commands. Scaling the limit by repository size is out of scope here.Refs GST-3398
Approvals
No approvals recorded for branch review-plan-timeout-everywhere.
Plan: exempt: bug fix GST-3398 (kind fix; failing-first test shown on main)
Plan check: exempt bug fix
Pre-Landing Review: 3 issues — 0 auto-fixed, 0 asked (0 fixed, 0 skipped), 0 deferred, 3 noted
Gate edits: none detected (4 listed, 3 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: openai/gpt-6.1-sol (host subagent) completed, VERDICT: CLEAN