Skip to content

Unattended /autoplan runs its configured second-model review in the foreground, and run ids no longer collide (GST-3015) - #4459

Merged
capy-ai[bot] merged 2 commits into
mainfrom
unattended-autoplan-runs-its-second-voice
Nov 17, 2026
Merged

capy-ai[bot] merged 2 commits into
mainfrom
unattended-autoplan-runs-its-second-voice

Conversation

@garrytan

@garrytan garrytan commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Unattended /autoplan --full now runs the second-model review when codex_reviews: enabled is set, runs it in the foreground with a 9-minute limit, and records a timeout with the standard failure line instead of ending the session. Two runs started in the same second also get different run ids now.
Why: in a planning test, Opus 5.5 skipped the second reviewer in 2 of 3 runs over consent the config had already given, and ended the third session while the review ran in the background.
Nothing to do: an unset codex_reviews is handled as before, and disabled is still enforced by the runner.

What changed

Unattended /autoplan now treats codex_reviews: enabled as consent and runs the second-model review in the foreground

Unattended /autoplan now treats codex_reviews: enabled as consent and runs the second-model review in the foreground.

The same before/after as text is in the Agent notes at the end (it quotes the new driver line, which uses an in-house word).

Someone who turned on second-model reviews and ran /autoplan without watching got a plan reviewed by one model, because the agent read its general consent rule as covering the second review, or started that review in the background and ended the session before it finished. gstack-autoplan next now prints OUTSIDE_CONSENT: given by codex_reviews=enabled beside the second-model attempt, and the driver text says that setting is the owner's consent, that the review runs in the foreground under a 9-minute limit, and which line to record when it fails. Run ids also include six random letters before the timestamp, so two runs in directories with the same name no longer share an id and a checkpoint folder.

Why

"I'm waiting on Codex's CEO review now", written right before an unattended session ended with the review still running, is the failure this fixes. A plan reviewed unattended now gets the second-model review its owner turned on, or a recorded reason it didn't.

Blast radius

The change touches the unattended autoplan runner's next output, the generated autoplan/DRIVER.md and unattended profile, and the run id format. The run id stays <name>-...-<14-digit timestamp> with the timestamp last, so the approvals importer's timestamp exemption still matches it; test/autoplan-run-id.test.ts imports a minted id through buildRow (script ran). A disabled setting still refuses before any dispatch (CLI probe 002 ran).

Pre-Landing Review

No blocking findings. One full review pass on this head: a batched specialist reader (testing, security, state machines) found nothing, the red team found two low-severity notes, the Claude adversarial pass found five (two duplicates of the red team's, one pre-existing test outside this diff), and the second-model review (GPT-6.1 Sol) returned clean.

Review notes

Below the blocking floor (a finding blocks only if it would fail a test, break production, or lose data or secrets); recorded here and not fixed in this PR.

  • INFORMATIONAL lib/approval-record.ts:157 The minted-id pattern still allows 64 characters before the timestamp, and that span now includes the six random letters, so a run directory named with 58 to 64 characters loses the timestamp exemption and gstack-approvals import --autoplan refuses it when the timestamp looks like a phone or card number. It fails closed and writes nothing.
  • INFORMATIONAL scripts/resolvers/autoplan-driver.ts:80 The unattended failure lines come from the Claude-host rendering, so they name Codex and the Claude Code Bash timeout even when a parent on another host uses a different second model.
  • INFORMATIONAL lib/autoplan-run.ts:286 Consent is checked once when the run starts; next re-reads the setting only to print the consent line, so switching to disabled mid-run drops the line while later phases still open second-model attempts (that part predates this PR).
  • INFORMATIONAL lib/autoplan-run.ts:286 The new OUTSIDE_CONSENT: given line shares the OUTSIDE_CONSENT: prefix with the consent_missing marker; no parser keys on that prefix today.
  • INFORMATIONAL test/approval-classes.test.ts:407 The adversarial reader saw "P1-4: a content diff that is missing or disagrees with git's count fails closed" exit 2 instead of 3 once locally, at this branch's base too; it passed in this run's focused test run and in CI. Not introduced by this diff.
Exploratory QA

Functional smoke, two CLI probes of gstack-autoplan next in isolated state roots with no API keys: with codex_reviews: enabled it printed the consent line beside voice=outside and minted run-reyhpv-20261117192717 (pass); with disabled it printed OUTSIDE: ceo not_run reason=consent_missing, opened no second-model attempt and printed no consent line (pass). Unset and unreadable settings and long directory names were not probed here.

Eval Results

Selector (bun run eval:select --base origin/main): PR profile full-fallback because scripts/resolvers/index.ts is a shared input; no quality judges and no case selected as a PR pass, so no paid evals ran. The 145 behaviors it lists remain scheduled and release coverage.

Scope Drift

Scope Check: CLEAN

TODOS

No TODO items completed in this PR.

Documentation

Status: current. No documentation edits were needed, and no blockers.

Scope: base e1cfcea..48bf37a: 2 commits and 14 files, all committed (none staged, unstaged or new). The changed doc sources and the docs whose claims the change could touch were audited.

Documentation health:
autoplan/DRIVER.md.tmpl Current (new AUTOPLAN_UNATTENDED_VOICE resolver line matches the code)
autoplan/sections/unattended.md.tmpl Current (codex_reviews consent and foreground-only wording matches)
docs/troubleshooting.md Current (run-id note about six random letters matches lib/autoplan-run.ts)
docs/unattended.md Current (no contradiction; coverage gap below)
changelog.d fragment Current

Documentation Debt

  • Common gap: the OUTSIDE_CONSENT: given by codex_reviews=enabled line and the rule that an unattended second-model review runs in the foreground with a 9-minute limit are documented only in autoplan/DRIVER.md. docs/unattended.md step 1 ("Dispatch each ATTEMPT:") does not mention them. A how-to sentence there would close the gap.

Diagram drift: none.

Tests
  • bun test test/autoplan-run-id.test.ts test/autoplan-unattended-voice.test.ts test/outside-consent.test.ts test/approval-classes.test.ts: 50 tests, exit 0
  • Full free suite in CI run 44157199979: 1,685 files, green at 48bf37a
  • macOS named regressions (run 44157199979) and Windows smoke (run 44157199965): green at 48bf37a
Agent notes

Refs GST-3015, GSTA-592

Approvals

No approvals recorded for branch unattended-autoplan-runs-its-second-voice.
Plan: exempt: bug fix
Plan check: exempt bug fix

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen
Gate edits: none detected (4 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Second-model review: openai/gpt-6.1-sol (host subagent), completed, VERDICT CLEAN.

Evidence: GEVA-549's smoke on c5250de, Claude sessions 9f4aab72 and d9cadfb2 (--unavailable "...sends data off this machine, which needs the owner's consent") and e180668a (run_in_background: true, then "I'm waiting on Codex's CEO review now").

Before/after as text: Unattended /autoplan now treats codex_reviews: enabled as consent and runs the second-model review in the foreground
--- Before · autoplan/DRIVER.md § The loop at e1cfcea · source text
+++ After · autoplan/DRIVER.md § The loop on this branch · source text
 ## The loop
 1. `next` prints one `ATTEMPT: <id> phase=<p> voice=native|outside prompt=<file> result=<file>`
    per voice. Dispatch the native prompt to a subagent on your model and the outside prompt to
+   a subagent on another model family (or `gstack-outside-voice run`). Each writes `result=`. The first `next` also prints `REVIEW_ESTIMATE:` (most attempts and reservations the review can take). **Outside voice, unattended.** A stored `codex_reviews: enabled` is the owner's standing consent to send each phase's review input to the outside model (`next` prints `OUTSIDE_CONSENT: given by codex_reviews=enabled`), so run the outside attempt: the preamble's unattended consent rule does not cover it, and you never close it `--unavailable` over consent or data leaving the machine. The runner itself enforces `disabled` or an unreadable config (`OUTSIDE: <phase> not_run reason=consent_missing`, no outside attempt); an unset `codex_reviews` keeps its existing handling. Run the voice in the foreground, inside this turn: `gstack-outside-voice run ... --timeout-ms 540000` with the tool's own timeout above it (Claude Code Bash `timeout: 600000`), or a subagent you await. Never `run_in_background`, never a monitor, never end the turn to wait for it: an unattended session ends with its turn. When the voice fails, `submit --voice outside --unavailable "<line>"` with the matching line and carry on in the same turn, the native voice still counting: **Auth failure:** If stderr contains "auth", "login", "unauthorized", or "API key": "Codex authentication failed. Run `codex login` to authenticate." **Timeout:** "Codex timed out after 9 minutes and was terminated; this pass produced NO findings." A timed-out pass is MISSING COVERAGE, not a clean bill — say so explicitly rather than continuing as if Codex had reviewed. **Empty response:** "Codex returned no response. Stderr: <paste relevant error>."
-   a subagent on another model family (or `gstack-outside-voice run`). Each writes `result=`. The first `next` also prints `REVIEW_ESTIMATE:` (most attempts and reservations the review can take).
 2. Submit each voice exactly once (`BOUND:`). Both voices in closes the phase (`PHASE_CLOSED:`).
 3. Repeat `next` until `status=gate_pending` (`GATE: gate_rev=<n>`); render it with `gstack-gate render <dir>/gate.json --all` and relay every page with the two cost lines printed under `GATE:`: `GATE_SPEND:` (spent, worst case, cap, headroom, attempts; host-subagent attempts are priced unknown and counted at their reservation, so quote their real figure from the host's cost view) and `GATE_REC_COST:` (the phases `rec` can reopen and the estimate for them, an upper bound; `gate_cost` in `--json`).
    You never approve the gate for the owner. Offer `rec` (every recommendation, plan changes included) as the default.

🤖 Generated with Claude Code

{
  "schema_version": 1,
  "pr": 4459,
  "head": "48bf37addffff4b4522313f106bfeac15e7c50ad",
  "version": "1.100.0.0",
  "base": "main",
  "gate": {
    "targeted": {
      "pass": 50,
      "fail": 0,
      "skip": 0
    },
    "free": {
      "pass": 1685,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44157199979,
      "attempt": 1,
      "tree": "e3a0190e9a44ce274209b5eb81a503f4852b8c8c"
    }
  ],
  "calls": 20,
  "session_kind": "unattended",
  "run": "ship-4459-48bf37ad",
  "head_tree": "e3a0190e9a44ce274209b5eb81a503f4852b8c8c",
  "product_patch_id": "3605a73784c91046a6b2e98cd68ce4677602b6e7",
  "gstack_version": "1.100.0.0",
  "review_depth": {
    "depth": "full",
    "class": "code",
    "runtime_lines": 29,
    "rules": "eea6cc4231b53b9e",
    "base": "e1cfceae6a3442f4e27818ac8e6885dc68dbb006",
    "registry": "e1cfceae6a3442f4e27818ac8e6885dc68dbb006",
    "gate_scan": {
      "tagged": 0,
      "head": "48bf37addffff4b4522313f106bfeac15e7c50ad"
    },
    "reasons": [
      "risk:security",
      "runtime=29"
    ],
    "risk": [
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @e3a0190e9a44 (8 checks, current for 48bf37addfff)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44157199979/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44157199965/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=e3a0190e9a44 tests=37562 skipped=104 runs=44157199979/1 profiles=ci-reuse/free-tests heads=48bf37addfff verified=2026-11-17T19:38:13.059Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CLAUDE.md, AGENTS.md and the changed autoplan templates (base e1cfceae..48bf37ad)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 2
  },
  "gate_dispositions": []
}

Open in Capy

…oreground, and run ids no longer collide (GST-3015)

An explicit codex_reviews: enabled is the owner's standing consent: gstack-autoplan next prints OUTSIDE_CONSENT beside the outside attempt, and autoplan/DRIVER.md tells an unattended host to run the voice in the foreground with a 9-minute limit and to record a failure with the standard outside-voice failure line instead of ending the turn. Run ids now carry six random letters before the time stamp, so two runs started in the same second no longer share a checkpoint folder.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit e671a53 into main Nov 17, 2026
58 checks passed
This was referenced Nov 18, 2026
capy-ai Bot added a commit that referenced this pull request Nov 18, 2026
- A test, or a scratch repository in the temp directory, can no longer write approval rows into your real Capy Drive (GST-3027). (#4466)
- An unattended /autoplan run on Claude Code no longer says the publication guard is off while it is on. (#4481)
- A phase report written only in reasoning now gets a denial that says so and names the fix. (#4481)
- `gstack-autoplan revise` no longer refuses a plan that the first `next` accepted. (#4470)
- `revise --plan` with a different file now says the run follows that file. (#4470)
- A second-model plan review in `/autoplan` is no longer reported as unavailable when it actually ran (GST-3051). (#4471)
- The /ship conductor trial plan now lets case reverts that conflict with later code be resolved by hand in docs, tests and the planted file, so large pull requests can be cases (GST-3003). (#4460)
- A locked plan for a trial of /ship without its separate conductor subagent (GST-3003). (#4456)
- A driven /ship now runs each phase as one command, counts its calls, and stops itself at 100 minutes. (#4451)
- /ship stops asking owners to clear two kinds of bookkeeping noise: base-side merge text and a reviewer's confirmation prose. (#4458)
- A base merge that only touched base-side text no longer stops `/ship` finish for an owner's grant. (#4458)
- A reviewer's confirmation prose no longer becomes a Critical finding that only an owner can clear. (#4458)
- A CI run that passed only after its failed jobs were re-run is now marked wherever gstack reuses it. (#4473)
- /ship reuses CI's passing test run when merging the base changed no file, and stops instead of quietly starting hour-long test runs or reviewing an empty diff (GST-3019). (#4461)
- /ship on Codex no longer stops at the test coverage audit. (#4489)
- A cold first-use check before an app build reaches its owner (GST-3025). (#4465)
- `skill_prefix=true` now survives updates when gbrain is installed. (#4454)
- The OpenClaw docs no longer send you to ClawHub, which held only April 2026 builds of office-hours, ceo-review and retro and no longer has gstack skills (the docs also said four skills while listing three). (#4454)
- `gstack-issue-links` no longer reads other repositories' issues as gstack's. (#4454)
- /ship's pre-gate finds the tests of a monorepo app that imports through its own `@/` alias. (#4464)
- /office-hours explains why it recommends a mode. (#4450)
- /office-hours keeps its 34 founder videos and essays out of the skill file. (#4463)
- Two `gstack-owner-answers add` runs for the same answer no longer collide. (#4490)
- A Captain can check an ask against the owner's earlier answers before sending it. (#4467)
- `gstack-post` stops reading /ship's own receipt identifiers as phone numbers, so posting a /ship PR body no longer needs a confirm. (#4488)
- GitHub release notes now list every change in plain words, with a link to its pull request. (#4390)
- gstack's router no longer gives bug reports a special rule, so the model fixes a bug the way it would without gstack. (#4442)
- /ship's review plan now sorts Swift and Xcode files by risk instead of sending every iOS PR to the full review panel (GST-3041). (#4469)
- /ship's review plan now sends Swift code that touches private user data to the full review panel (GST-3052). (#4472)
- A round grant at /ship's review round cap now buys the fix round it names, in the same run or the next (GST-2968). (#4479)
- The secrets check stops flagging three kinds of ordinary code as a secret, and catches two misses. (#4457)
- A security finding's location and reason no longer go into a PR body. (#4486)
- The token-capped /ship child on Claude Code now starts its prompt with the typed `/ship` command, so the skill actually loads. (#4487)
- A /ship receipt now counts the second-model review's blocking findings, and refuses to be written while one is still open. (#4485)
- A `/ship` with a token cap on Claude Code no longer stops at its first handoff. (#4452)
- /ship's push step now always ends with one line that says whether it pushed (GST-3053). (#4474)
- A PR's review-round count can no longer be overwritten by the body `/ship` posts. (#4440)
- One queued record with a malformed path no longer stops artifacts sync for every project. (#4455)
- A failed artifacts push stays reported until a push succeeds. (#4455)
- The /sync-gbrain memory row no longer says OK when pages failed to import. (#4455)
- ### Tests (#4495)
- A policy-floor test no longer fails once gstack's own version reaches the minor after the newest policy key; it now checks a floor above both, so the v1.101.0.0 release can pass CI. (#4495)
- CI now uploads free-suite test results to Trunk with analytics-uploader v2.1.8 and analytics-cli 0.17.0, up from v2.1.6 and 0.16.2. (#4453)
- Packing a checkout for a Ubicloud run no longer fails when git beside it is rewriting a ref. (#4447)
- The /plan-ceo-review HOLD SCOPE eval no longer fails a review because its follow-up question didn't repeat the mode name. (#4447)
- Unattended /autoplan now records the owner's relayed gate reply instead of refusing it. (#4484)
- Unattended /autoplan now runs the second-model review you turned on, and waits for it instead of ending the session. (#4459)
- Two /autoplan runs started in the same second no longer share a run id. (#4459)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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