Skip to content

v1.91.368.0 fix: gstack-pregate --remote gives the gate its full timeout and shows its last line (GST-431) - #3682

Merged
capy-ai[bot] merged 3 commits into
mainfrom
gsta195-pregate-remote-progress
Oct 31, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
gsta195-pregate-remote-progress

Conversation

@garrytan

@garrytan garrytan commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3682,
  "head": "8ae9b135cd19c1729f4233b739ed5706ce5177b5",
  "version": "1.91.364.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 337,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "cd1c3d46584b87c3992e23729f5ccdbd097f0cc9",
  "product_patch_id": "9aaa89e730469293194d72f9982855ea33f73275",
  "gstack_version": "1.91.356.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 41,
    "rules": "1ef4ba88e39e688c",
    "base": "088bfc5914f8001a3d49b3a0c35d6f7cb800268c",
    "registry": "088bfc5914f8001a3d49b3a0c35d6f7cb800268c",
    "gate_scan": {
      "tagged": 0,
      "head": "8ae9b135cd19c1729f4233b739ed5706ce5177b5"
    },
    "reasons": [
      "gate-class",
      "runtime=41<=50"
    ]
  },
  "pregate": "requires-remote cleared @cd1c3d46584b (1 checks, current for 8ae9b135cd19)",
  "requires_remote": [
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41197254696",
    "pregate.json/remote_gate: remote-gate tree=cd1c3d46584b tests=1984"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 3,
    "fixed": 4,
    "scope": "frozen",
    "fix_checks": 1,
    "dispatches": {
      "specialist": 3
    }
  }
}

What changed

gstack-pregate --remote now gives the remote gate its full timeout. Before, a gate that waited on CI and printed nothing was killed as stalled after 300 s.

Before/after as text
$ gstack-pregate --stage tests --remote --spend-cap 2 --stall-timeout 1 --timeout 60   # gate quiet for 2.5 s, then reports
- before: lanes incomplete PREGATE_STALLED (the remote gate did not finish (no output for 1 s)); obligation uncleared
+ after:  requires-remote cleared (remote gate pregate.json/remote_gate: 3 tests, 0 failed)
$ ... --timeout 2   # gate quiet for 8 s
+ after:  lanes incomplete PREGATE_INCOMPLETE (the remote gate did not finish (timed out after 2 s, --timeout)); obligation uncleared

Why

CAPY-1 (qm#2837) reported that "gstack-pregate --remote hits its 300s limit while silently polling CI" (GST-431). Their remote gate waits for a CI run and prints nothing while it waits, so pregate's test-output stall timer killed it at 300 s whatever --timeout said. Now only the timeout bounds the gate, and the 60 s heartbeat shows the gate's last output line.

Blast radius

Only --remote changes. The lanes runner and guards still pass the stall timeout (lib/pregate/checks/lanes.ts, read). gstack's own gate (scripts/ubicloud/pregate-remote.sh) sizes its VM from PREGATE_TIMEOUT_S and keeps its own watchdog, and the remote free tier passed on this tree (script ran).

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-31 Take GST-431 after PR A and PR B are READY “after PR A and PR B are READY, take GST-431. Make gstack-pregate --remote print progress while polling CI and use the timeout_s being added. Same fix-lane rules; a short eng-only plan note in the READY is enough, with no separate gate. Cap +$20.” (GStack Minder) approved GST-431 fix under the fix-lane exemption, eng-only plan note none

Source: gstack-approvals record for gsta195-pregate-remote-progress (display only; not an approval citation).

Summary

Was stacked on #3676 (landed as 088bfc5). Replayed onto main with an unchanged product patch-id (a84724a3) after it landed. Parent issue GST-422. GST-431 (from CAPY-1, qm#2837).

Eng-only plan note (fix lane, no separate gate). Cause: runRemote supervised the gate with the stall timer (default 300 s). Fix: the remote gate gets stallMs: 0 and is bounded by --timeout, else timeout_s, else 600 s. Its heartbeat names its last output line, with ANSI escapes and carriage-return redraws cleaned out, and the read is best effort. A timeout names its seconds and source. The negative control: a gate past --timeout stays uncleared.

Behavior changes

  • --stall-timeout (and stall_timeout_s) no longer applies to the --remote gate. A hung gate now runs to its timeout (--timeout 2700 in the crew recipe) instead of dying at 300 s.

Test Coverage

New tests were red first: a quiet gate inside its timeout clears; a gate past --timeout stays uncleared; the heartbeat names the last line (including a \r redraw with an escape); a log removed mid-run does not crash the supervisor.

Tests ran: focused 360

Pre-Landing Review

No blocking findings remain. The outside voice (GPT-6.1 Sol) found that the new log read could throw out of the supervisor's timer if the log disappeared, which would abandon the gate's deadline. That is fixed with a failing-first test. The native adversarial pass found raw escapes in the heartbeat and a timeout detail without its source, both fixed. A fix-check on the touched hunks found only informational items.

REVIEW_LOOP: passes=1 blocking_found=1 deferred=0 noted=3 fixed=4 scope=frozen fix_checks=1 dispatches=3

Gate edits: none detected (test hunks are new tests and one fixture-gate option)

Review notes

  • timeoutSource is optional on PregateContext; a hand-built context would print "undefined" in the timeout detail. Production contexts always set it.
  • OSC title sequences (ESC ] … BEL) are not stripped from the heartbeat line; only the visible text is affected.
  • --timeout itself has no upper bound on the CLI, so a third-party gate without a watchdog can hold a lane for as long as the timeout says.

TODOS

No TODO items completed in this PR.

Documentation

Scope: the committed diff against aab795ec. The --remote gate is now limited only by its timeout, not the stall timer, and its heartbeat names the gate's last output line. Reviewed docs/pregate.md (config table, supervision, remote gate), the PREGATE_STALLED entry in docs/troubleshooting.md, the gstack-pregate help text, the pregate-remote.sh comment, the changelog fragment, and the top-level docs.

Result: current. The branch already updates every affected doc, and they match the code in lanes.ts and supervise.ts. A search of the docs found no other text saying the remote gate stalls.

Debt: one rewritten line in the troubleshooting entry runs past the usual wrap width. It's cosmetic.

Test plan

  • focused lane (7 files): 360 pass, 0 fail
  • bun run typecheck: clean
  • remote free tier on one Ubicloud VM: 24305 tests, 0 failed, $0.06 (tree c118506aab9a)

🤖 Generated with Claude Code

@trunk-io

trunk-io Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits October 31, 2026 11:30
…; heartbeat names its last line (GST-431)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…out detail names its source (review fixes)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@garrytan
garrytan force-pushed the gsta195-pregate-remote-progress branch from f7d4270 to 8ae9b13 Compare October 31, 2026 11:32
@github-actions github-actions Bot changed the title fix: gstack-pregate --remote gives the gate its full timeout and shows its last line (GST-431) v1.91.368.0 fix: gstack-pregate --remote gives the gate its full timeout and shows its last line (GST-431) Oct 31, 2026
@capy-ai
capy-ai Bot merged commit 4a2793e into main Oct 31, 2026
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant