Repository navigation
Description
What happens
GitHubProvider.checkAuthSync() (src/lib/workflow/platforms/github.ts:136) runs execSync("gh auth status", { stdio: "ignore" }) with no timeout. gh auth status reaches the network, so a stalled request or a hung gh hangs every caller with no output and no way out but Ctrl-C. Callers today: src/lib/system.ts:30 (checkGhAuth, used by doctor) and src/lib/upstream/assessment.ts:64.
#1075 bounded the three sibling probes in doctor.ts (opencode --version, codex --version, codex login status) and its QA named this one as "the true cross-file sibling" left out only because GitHubProvider owns gh. This is that follow-up.
Scoped repo-wide before filing: every other un-timed execSync in src/ is local (git …, command -v, which aider). This is the last network-reaching one.
Fix shape
Pass timeout (the #1075 constants are the precedent: 10s for a network-reaching auth check) and let ETIMEDOUT fall into the existing catch → false. No new error handling. Update the two unit tests that assert the exact execSync options (github.test.ts:43, system.test.ts:74).
Release-graph plan — pre-2.16.0 follow-ups (2026-09-19)
Graph: pre-2.16.0 follow-ups Tier: mechanical Wave: 2
May touch: src/lib/workflow/platforms/github.ts, src/lib/workflow/platforms/github.test.ts, src/lib/workflow/platforms/github.integration.test.ts (new), src/lib/system.test.ts, CHANGELOG.md
Acceptance Criteria
- AC-1:
checkAuthSyncpasses atimeouttoexecSync— Evidence:grep -A4 '"gh auth status"' src/lib/workflow/platforms/github.ts | grep -c "timeout:"prints 1 (today 0) - AC-2: a hanging
ghon PATH makescheckAuthSync()return false within the timeout instead of hanging — Evidence:npx vitest run src/lib/workflow/platforms/github.integration.test.ts -t "1099" 2>&1 | grep -E "Tests +[1-9][0-9]* passed"prints a passed line (a sleepingghstub on PATH, a bounded wall-time assertion, and the result assertedfalse) - AC-3: the existing unit assertions on the exact
execSyncoptions are updated, not loosened — Evidence:npx vitest run src/lib/workflow/platforms/github.test.ts src/lib/system.test.ts 2>&1 | grep -E "Tests +[1-9][0-9]* passed"prints a passed line andgrep -c "timeout" src/lib/workflow/platforms/github.test.ts src/lib/system.test.ts | grep -vc ":0$"prints 2 - AC-4: no other network-reaching
execSyncinsrc/is left un-timed — Evidence:grep -rn 'execSync("gh \|execSync(gh ' src --include='*.ts' | grep -v ".test." | wc -l | tr -d " "prints the same number asgrep -rn -A4 'execSync("gh |execSync(gh ' src --include='*.ts' | grep -v "\.test\." | grep -c "timeout:"
AC-2 is a gate test: mutation-verify (drop the timeout option → the case fails its wall-time bound) and record the marker.
Placement note
The sleeping-stub case goes in a new github.integration.test.ts next to github.test.ts — the integration vitest project matches **/*.integration.test.ts anywhere; a file without .integration. runs under the 5s unit budget (#842) and a timeout test will blow it. Stub with exec sleep 25 so the killed child is the direct child (see #1075's PR body).
Activity
admarble commentedon Sep 19, 2026
Runner context (2026-09-19, wave 2 of the pre-2.16.0 graph)
mainat52cd790e(chore(doctor/templates): timeout the codex+opencode CLI probes; add the missing templates/codex routing test #1075 and bug(init): init --agent <name> on an initialized repo overwrites .sequant/settings.json with defaults #1071 both merged).timeout. Never background it.Mutation-verified: AC-N — <mutation>; <test> failed; restored.marker in the PR body, machine-anchored as<!-- SEQUANT_MUTATION: {"ac":"AC-N","mutation":"...","failedTest":"<test file path> > <describe> > <case>"} -->. ThefailedTestvalue must start with the test file's path (e.g.src/commands/init.test.ts > ...) — chore(doctor/templates): timeout the codex+opencode CLI probes; add the missing templates/codex routing test #1075's first QA failed solely because that prefix was missing.CHANGELOG.mdUnreleased entry; add yours alongside. Do not reformat neighbouring entries.admarble commentedon Sep 19, 2026
/spec — Plan (#1099)
Complexity: Standard (4 ACs, 2 directories)
AC Quality Check
lintAcceptanceCriteria: 3/4 passed, 1 flagged. AC-4 trips the "open_ended" pattern on the word "other" ("no other network-reachingexecSync..."). False positive — the AC carries a fully computableEvidence:clause (twogrep -ccounts that must match), so "other" is scoped by the grep pattern, not left vague. No action needed.Behavior-rule detector: no AC matches (
default|always|never|rule|behavior|skip, or analways/never X unless Ypattern) — no Rule Touchpoints section.Scope Assessment
Non-Goals: not present as a section, but the body scopes itself explicitly (single function, "Fix shape" section, exact call sites named). Adequate for a mechanical node.
src/lib/)Verdict:⚠️ SCOPE_WARNING (missing Non-Goals section only — every metric is green; not a scope-splitting signal for a 1-function, 1-file fix).
Acceptance Criteria — verification
AC-1 —
checkAuthSyncpasses atimeouttoexecSyncVerification: Integration Test (grep gate)
Scenario: Given
github.ts:136→ Whengrep -A4 '"gh auth status"' ... | grep -c "timeout:"→ Then prints1.AC-2 — a hanging
ghon PATH makescheckAuthSync()returnfalsewithin the timeout, not hang [GATE]Verification: Integration Test (parser infers "unit_test" from keywords, but the Evidence clause targets a new
github.integration.test.ts— must live there, not ingithub.test.ts, per the Placement note)Scenario: Given a
ghstub onPATHthatexec sleep 25s → WhencheckAuthSync()is called → Then returnsfalseand elapsed wall time stays under a bound comfortably below 25s but above the newtimeout.Assumptions:
execSyncinheritsprocess.env.PATH; stub mustexec sleep 25(not fork it) so the killed child is the direct child — a forked grandchild can outliveSIGTERMand hold the pipe open past the timeout (same failure mode #1075 called out).AC-3 — existing unit assertions on the exact
execSyncoptions are updated, not loosenedVerification: Unit Test —
github.test.ts:43andsystem.test.ts:74currently asserttoHaveBeenCalledWith("gh auth status", { stdio: "ignore" }); both must gaintimeout: <N>in that same object, not a separate looser matcher (e.g.expect.objectContaining).AC-4 — no other network-reaching
execSyncinsrc/is left un-timedVerification: Integration Test (grep gate) — confirmed now:
grep -rn 'execSync("gh \|execSync(\gh ' src --include='*.ts' | grep -v '.test.'returns exactly one hit,github.ts:136` — the one this issue fixes. No other sibling to sweep in.Implementation Plan
Phase 1 —
src/lib/workflow/platforms/github.ts(AC-1)AUTH_PROBE_TIMEOUT_MS = 10_000next tocheckAuthSync(precedent: chore(doctor/templates): timeout the codex+opencode CLI probes; add the missing templates/codex routing test #1075'sAUTH_PROBE_TIMEOUT_MSindoctor.ts, same 10s bound reasoning —gh auth statusreaches the network, so a legitimately slow check over a poor link must not be misreported as unauthenticated).timeout: AUTH_PROBE_TIMEOUT_MSto theexecSync("gh auth status", { stdio: "ignore" })call at line 136. No new error handling — Node throwsETIMEDOUTinto the existingcatch { return false; }, which every caller (system.ts,doctor.ts,upstream/assessment.ts) already treats identically to "not authenticated."Phase 2 —
src/lib/workflow/platforms/github.integration.test.ts(new file, AC-2)3. New file (doesn't exist yet). Mirror #1075's
doctor.integration.test.tsstub-on-PATH pattern:describe.skipIf(process.platform === "win32")("checkAuthSync timeout (#1099)", { timeout: 45_000 }, ...).4.
beforeEachwrites aghstub (#!/bin/sh\nexec sleep 25\n, mode0o755) into amkdtempdir; awithStubPath(fn)helper prepends it toPATHin atry/finally, scoped to the callback (not a file-level hook) so no other case in the suite leaks the stub.5. One case, name containing
1099(the evidence command greps-t "1099"): callnew GitHubProvider().checkAuthSync(), assertfalseandDate.now() - t0 < 15_000(1.5× the 10s timeout, generous for CI, well under the 25s stub — same ratio #1075 used for its auth-probe case).6. Lives in
*.integration.test.tsdeliberately — theunitproject keeps vitest's 5s default (#842) and this case needs up to 10s+.Phase 3 —
github.test.ts+system.test.ts(AC-3)7. Update both
toHaveBeenCalledWith("gh auth status", { stdio: "ignore", ... })assertions (github.test.ts:43,system.test.ts:74) to includetimeout: 10000in the same object literal — an exact-match update, notexpect.objectContaining, so the assertion stays a real gate on the option value.Phase 4 — mutation verification (AC-2)
8. Start from
git status --short | wc -l= 0 (commit Phases 1–3 first). Drop thetimeout:line fromgithub.ts→ the new1099integration case fails on the wall-time bound (sleeps the full 25s, inside the 45s describe budget — it fails, it does not hang, sinceexecSyncis synchronous and vitest cannot interrupt it). Restore, then recordMutation-verified: AC-2 — dropped timeout: AUTH_PROBE_TIMEOUT_MS from checkAuthSync's execSync call; github.integration.test.ts > checkAuthSync timeout (#1099) > ... failed on the elapsed-time assertion; restored.plus its<!-- SEQUANT_MUTATION: {"ac":"AC-2", ...} -->anchor (failedTestmust start withsrc/lib/workflow/platforms/github.integration.test.ts > ...) in the PR body.9. Add a
### Fixedbullet under[Unreleased]inCHANGELOG.md, keeping every existing entry.Design Review
GitHubProvider.checkAuthSync()— it already owns thegh auth statuscall and itscatch → falsecontract; a hang is just a slower form of "not authenticated."spawnSyncwith manual process management (same semantics, more code); wrapping inPromise.race(would forcecheckAuthSyncasync, rippling into every sync caller —system.ts,doctor.ts,upstream/assessment.ts— for no user-visible gain, exactly the tradeoff chore(doctor/templates): timeout the codex+opencode CLI probes; add the missing templates/codex routing test #1075 rejected for the same reason).AUTH_PROBE_TIMEOUT_MStreatment ofcodex login status— same "network-reaching, needs a longer bound than a local probe" reasoning, same 10s value.gh auth statusover a bad connection must not be misreported as unauthenticated, and every caller already tolerates a falsecheckAuthSync()gracefully (init/doctor print a hint, upstream assessment skips silently).Feature Quality Planning
All standard checks pass. Notable items:
git worktree listshows a pre-existing empty worktree atfeature/1099-...(HEAD ==main, no diff) — safe to use, not stale work to preserve.github.integration.test.ts, notgithub.test.ts— theunitproject's 5s default (fix(test): tsx-spawning integration tests blow vitest's 5s default — phase-registry should use the prebuilt dist like its five siblings #842) would kill it.Sibling-site scan
Repo-wide grep (
execSync("gh \|execSync(\gh, excluding*.test.ts`) returns exactly one hit — the one AC-1 fixes. No further siblings to flag; AC-4 already gates against a regression here becoming untrue later.Open Questions
AUTH_PROBE_TIMEOUT_MS = 10_000— reuse chore(doctor/templates): timeout the codex+opencode CLI probes; add the missing templates/codex routing test #1075's exact value, or define independently? — Recommendation: reuse10_000(same constant name pattern, not a shared import — the two modules don't otherwise depend on each other). Impact if wrong: a shared constant would coupledoctor.tsandgithub.tsfor no benefit; a different value would need its own justification, and 10s already has one from chore(doctor/templates): timeout the codex+opencode CLI probes; add the missing templates/codex routing test #1075.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: SCOPE_OK on every metric (only the Non-Goals heuristic trips SCOPE_WARNING), 4 tight evidence-bearing ACs, ~2 lines of source plus tests. testgen is deliberately skipped even though AC-2/3 declare test evidence: the tests are the deliverable and are already specified down to the stub script and assertion bounds (mirroring #1075's identical reasoning), so generated stubs would be overwritten immediately. No UI, so no
testphase; no new auth/secret surface, so nosecurity-review.Label Review
Current:
enhancementRecommended: add
planned,cli,no-browser-testReason: CLI-surface chore with no UI;
no-browser-testmakes the skippedtestphase explicit rather than inferred (same set #1075 landed with).Quality Loop: Won't auto-enable — SCOPE_OK on every metric.
→
gh issue edit 1099 --add-label planned --add-label cli --add-label no-browser-testadmarble commentedon Sep 19, 2026
Runner note (2026-09-19) — previous exec killed at the 30-minute wall; resuming
The first exec pass was killed by the MCP phase watchdog while running the full suite (two worktrees plus a third session's suite were sharing the machine). Your WIP checkpoint commits survived in the worktree; the runner restored tracked root files a killed test had moved aside. Resume from the committed state.
For this resume, in both exec and qa:
npm test. Runnpm run build,npm run lint, and only the test files this diff touches (plus the AC evidence commands). The runner runs the full suite once before merge and records the result on the PR.failedTeststarting with the test file path.admarble commentedon Sep 19, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 0/6 met
Gaps:
SEQUANT_MUTATIONmarker is malformed and this repo's own parser rejects it. The PR body records"failedTest":"1099: a hanging gh makes checkAuthSync() return false within the timeout, not hang"— the test name with no file segment.classifyMutationMarker(mutation-marker.ts:139) doesmarker.failedTest.split(">")[0].trim()and matches that against the diff's test files; with no>the whole title is taken as the filename and matches nothing. Run against this PR:Suggestions:
AUTH_PROBE_TIMEOUT_MSnow exists twice —doctor.ts:69andgithub.ts:30— same name, same value, near-identical doc comment. Sharing it would couple a command to a platform provider for a single number, so duplication is defensible; worth a follow-up only if a third network probe appears.exec:completedphase marker was posted on chore(github): timeout the gh auth status probe — the last un-timed network execSync (#1075 follow-up) #1099 (onlyspec:completed), despite exec having produced two commits and PR chore(#1099): timeout the gh auth status probe #1103 — the bug(qa): the qa phase rebases an already-pushed branch onto main, forcing a force-push to land it #1069/bug(qa): a failing qa verdict (AC_NOT_MET) is never posted to the issue — posting is gated on phase success #1070 silent-phase class. Not this PR's defect; noting it because it made Phase 0 detection fall through to the commits-exist path.fix(#1099): timeout the gh auth status probe, the last un-timed netwo…