Skip to content

The Codex readiness check and the second-model review pick the same model for a custom Codex provider (GST-3089) - #4491

Merged
capy-ai[bot] merged 3 commits into
mainfrom
codex-custom-provider-one-plan-review-model
Nov 18, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
codex-custom-provider-one-plan-review-model

Conversation

@garrytan

@garrytan garrytan commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

With a custom Codex provider, gstack-codex-probe role-ready and gstack-outside-voice run --runner codex-cli now resolve the plan-review model the same way, so a session no longer skips a review that would have run.
Why: the check refused a config.toml naming gpt-6-astra while the runner ran it, and a day-one eval session dropped the second-model review in every phase.
Nothing to do: a custom provider naming the frontier catalog ID just works; any other name now says how to opt in.

What changed
  • One resolver: resolveCodexPlanReviewModel reads the Codex config model through the same function the runtime selection uses, and resolvePlanReviewModel decides tier membership for a custom provider.
  • gstack-codex-probe select-model takes --role plan-review (the same selection role-ready makes, without its auth, sandbox and probe checks). The codex-cli runner passes it for the autoplan and spec gates, the same gates whose generated skill invocations use the plan-review role. Other gates keep their current selection.
  • Every policy refusal prints CODEX_MODEL_POLICY: <reason>, so the probe's stderr and the runner's meta.json detail show the same reason code.
  • Side effect on the stock OpenAI provider. For autoplan and spec the runner now runs the plan-review tier's model, as role-ready already did, instead of whatever config.toml names.
  • Docs: docs/model-policy.md, docs/troubleshooting.md#model-policy-provider, and a changelog fragment.
Why

The named model counts as the frontier plan-review model only when it is exactly the selected tier's catalog ID (gpt-6-astra for the default frontier tier). The refusal exists for two reasons in docs/model-policy.md: gstack must not guess that a public ID works at someone else's endpoint, and generic coding-model settings must not quietly pick a cheaper plan reviewer. A catalog frontier ID that the user already routes to their endpoint is neither a guess nor cheaper, so the probe was wrong to refuse it. Any other name (a smart-tier ID, a deployment alias) could be any model, so the outside-voice runner was wrong to run it as a plan review. Both now refuse it with custom_provider_model_not_tier and point at model_frontier_openai, GSTACK_CODEX_MODEL or plan_review_tier host. A custom provider with no model keeps custom_provider_requires_model.

Blast radius

Codex model selection for plan reviews only. Users of a custom Codex provider whose config.toml names the frontier catalog ID now get the review. Users naming any other model get a refusal with repair steps instead of a review on an unknown model. Stock-provider users of autoplan and spec now get the plan-review tier's model, matching what role-ready already checked.

Documentation

Status: current. The docs already match the change, so no edits were needed.

Scope: base 782f459 to head 5b5d10a (2 commits, 8 files), plus the unstaged changelog.d fragment. This change makes the Codex readiness check and the second-model review pick the same plan-review model for a custom Codex provider.

Documentation health

  • docs/model-policy.md: current. It covers the exact-tier-ID exception, the custom_provider_model_not_tier refusal, and the shared selection between role-ready and outside-voice.
  • docs/troubleshooting.md: current. It lists both CODEX_MODEL_POLICY: refusal lines.
  • Skill sections that call select-model exec: current, because --role is optional.

Coverage debt: gstack-codex-probe select-model --role plan-review is documented only in the probe's usage text (reference coverage only). No diagram drift was found.

Tests

test/codex-custom-provider-agreement.test.ts (synthetic CODEX_HOME/config.toml, fake codex CLI, no paid calls) runs both tools on: a custom provider naming gpt-6-astra (both accept and run it), naming gpt-6.1-sol (both refuse, same reason code, nothing sent), naming no model (both refuse, same reason code), the smart tier accepting the smart ID, and a stock-provider control. The four agreement cases failed on 782f459 before the fix. The full free suite ran in CI (run 44346384986).

Pre-Landing Review: 4 issues, 0 fixed, 0 deferred, 4 noted (all below the blocking floor). One full review round at tree e09a007e (reviewer: batched testing/security/state-machines/red-team checklist, NO FINDINGS; adversarial reader: three low notes). No second-model review: the review plan skips it for this code class.

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)

Coverage gate: 75% (9 of 12 changed paths have a test; target 80%). No test generation was authorized for this run, so the three small gaps are listed as proposed tests:

  • selectionRepair for a native source (lib/model-policy.ts): one row in test/model-policy.test.ts.
  • The runner leaves --role plan-review off for gates other than autoplan and spec (lib/outside-voice-runner.ts).
  • role-ready still rejects --role: one more row in the agreement test's bad-arguments loop.

Scope Check: CLEAN. Intent: make role-ready and the codex-cli runner pick the same plan-review model for a custom Codex provider. Delivered: one shared resolver, select-model --role plan-review, the shared reason code, docs and the agreement test.

Review notes
  • lib/model-policy-cli.ts:328: gstack-models resolve and list call resolvePlanReviewModel without the config.toml reader, so this diagnostic still reports custom_provider_requires_model for a custom provider naming the tier's catalog ID, while the check and the review accept it.
  • scripts/resolve-codex-generation-model.ts: under custom routing, a malformed or unreadable config.toml is still refused, but with a plain error and no CODEX_MODEL_POLICY: line. The changelog now says "each of these policy refusals".
  • lib/outside-voice-runner.ts:135: with the stock provider, autoplan and spec now run the catalog plan-review model without the model probe role-ready runs, so an account that cannot use it sees the review fail at dispatch. Intended and documented above.
  • [ADVISORY] lib/model-policy.ts:576: policy errors join problem and cause with a bare space (unchanged from main).
Exploratory QA

Status: pass (4 smoke probes on isolated fixtures, bin/gstack-codex-probe at 5b5d10a). A custom provider naming gpt-6-astra selects it for plan review (exit 0). One naming a deployment alias is refused with CODEX_MODEL_POLICY: custom_provider_model_not_tier and the three opt-in repairs (exit 1, nothing selected). role-ready --role is a usage error (exit 64). select-model exec without --role keeps the alias (exit 0). The runner path is covered by the agreement test, not probed here.

Approvals

No approvals recorded for this branch.
Plan: exempt: bug fix

Agent notes

Agent notes

Lane GSTA-620 for GST-3089, reported by GEVA-549. Decision trail: captain drive reports/GSTA-620-decisions.tsv. /ship run ship-4491-2520155: one review round at tree e09a007e; 3ac1dab adds only the changelog wording (finish route metadata=1).

{
  "schema_version": 1,
  "pr": 4491,
  "head": "3ac1dabb688aab5d5c602eb8175d95014d7c952f",
  "version": "1.100.0.0",
  "base": "main",
  "gate": {
    "targeted": {
      "pass": 5,
      "fail": 0,
      "skip": 0
    },
    "test": {
      "pass": 1699,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44346384986,
      "attempt": 1,
      "tree": "1747ae9395c92a1ddea43e1e8000029d7bfc1e25"
    }
  ],
  "calls": 26,
  "session_kind": "unattended",
  "run": "ship-4491-2520155",
  "head_tree": "1747ae9395c92a1ddea43e1e8000029d7bfc1e25",
  "product_patch_id": "fbe5254e7707826d8bbff53ab7cdc394649ed49d",
  "gstack_version": "1.100.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 97,
    "rules": "1afa38a4be3b5eef",
    "base": "782f4595eddde19972bf673f0392567ce67aa7f7",
    "registry": "782f4595eddde19972bf673f0392567ce67aa7f7",
    "gate_scan": {
      "tagged": 0,
      "head": "3ac1dabb688aab5d5c602eb8175d95014d7c952f"
    },
    "reasons": [
      "runtime=97"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @1747ae9395c9 (8 checks, current for 3ac1dabb688a)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44346384986/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=1747ae9395c9 tests=37839 skipped=67 runs=44346384986/1 profiles=ci-reuse/free-tests heads=3ac1dabb688a verified=2026-11-18T16:33:58.834Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ and README.md (docs/model-policy.md, docs/troubleshooting.md read in full)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 4,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 3,
    "dispatches": {
      "specialist": 1
    }
  },
  "gate_dispositions": []
}

Open in Capy

…odel for a custom Codex provider (GST-3089)

A custom Codex provider whose config.toml names the frontier catalog ID is
now accepted for plan review by both gstack-codex-probe role-ready and
gstack-outside-voice run --runner codex-cli; any other name is refused by
both as custom_provider_model_not_tier, and no name stays
custom_provider_requires_model.

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

trunk-io Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits November 18, 2026 15:50
…ial scan

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 45f879b into main Nov 18, 2026
82 checks passed
@garrytan garrytan mentioned this pull request Nov 19, 2026
capy-ai Bot added a commit that referenced this pull request Nov 19, 2026
- `gstack-artifact validate` no longer passes a run.json that gstack-autoplan never wrote. (#4494)
- /ship's changed-number check no longer stops on tests that only share a word with the change (#4478). (#4496)
- On Capy, /ship no longer edits or comments on pull requests as you. (#4518)
- The destructive-command check stops asking about scratch deletes and catches the real damage it used to miss. (#4513)
- The destructive-command check reads commands more carefully, closing gaps found after the last release. (#4525)
- The Codex readiness check and the second-model review now pick the same model for a custom Codex provider (GST-3089). (#4491)
- gstack's Codex hooks work when your Codex folder's path has a `(`, `&` or other shell character in it. (#4528)
- Uninstalling gstack keeps your own Codex hooks trusted. (#4528)
- Codex hook setup matches Codex more closely. (#4528)
- On Windows, setup copies the Claude Code hook code that gstack's Codex hooks import (#4528)
- /review's checklist on Codex reads shell commands more carefully. (#4528)
- On Codex, gstack now suggests the right skill for a prompt and stops destructive commands before they run. (#4512)
- On Codex, /review is now held once when it tries to finish without its adversarial pass or its report, as it already is on Claude Code. (#4522)
- On Codex, gstack's skill suggestion now names the skill the way Codex lists it. (#4523)
- On Codex, gstack's suggested prompts and docs now name skills the way Codex lists them. (#4524)
- /review on Codex with gpt-6.1-sol is no longer held back for a second-model pass it already ran. (#4526)
- On Codex, office-hours, plan-design-review and gstack-upgrade work again when you name them. (#4510)
- gstack knows when Codex is running unattended. (#4510)
- Codex reviewers start with a clean context. (#4510)
- Docs no longer say Codex has no hook support. (#4510)
- A command whose output was cut off no longer counts as a finished read. (#4492)
- A folder marked as published data can no longer hide source code or agent files from /ship's review. (#4516)
- Correction to the on-by-default helper hooks entry: the hook still routes only to /review, /qa and /verify, so skills you've installed yourself aren't suggested yet. With gstack's skills it routes 14 of 60 real bug reports (was 17), and long prompts are no longer skipped. (#4505)
- /sync-gbrain's read check now works when the first page in your code source is over 64 KB. (#4497)
- Free-suite CI no longer fails before any test runs when Ubuntu's package mirror is slow. (#4530)
- Syncing a second repo no longer makes the first one ask for /sync-gbrain again. (#4532)
- gstack's helper hooks are now on by default in Claude Code, OpenClaw and Hermes, and the prompt-routing hook fires on real bug reports. (#4503)
- `gstack-pregate clear --receipt` accepts a remote gate run from before a merged release when the release only regenerated a declared release output. (#4483)
- The second-model review now keeps the reviewer's own result, and reports a used-up budget as a budget stop. (#4515)
- When the reviewer wrote its review to the result file it was asked for, Codex then replaced that file with its short closing message ("Done, I wrote the review"), so the review was thrown away and reported as missing its markers. (#4515)
- When the provider refuses the call with HTTP 402 Payment Required (usually a metering proxy that hit its allowance, or an account out of credits or quota), gstack used to record only "exit 1". (#4515)
- The pre-commit /verify check now fails a check that times out, and its checks share one time budget (GST-3201). (#4527)
- /ship's review collector no longer reads a reviewer's own scope list or list of passed checks as findings (GST-3201). (#4527)
- Merge-queue stack tests fail when git cannot list a PR's added test files (GST-3201). (#4527)
- /ship can now review results PRs that publish raw session data. (#4511)
- /ship's review pass works when the checkout you ship isn't the project's default checkout. (#4507)
- A second review round no longer reports done when nothing was reviewed. (#4520)
- The prompt-routing hook now suggests skills you install yourself, and no longer sends ordinary bug reports to /qa (GST-3123). (#4506)
- gstack's script runner and merge-queue checks now also refuse cut-off output. (#4502)
- A failed second-model review reports the cause that actually stopped it, and the runner never deletes its own prompt. (#4519)
- `gstack-ship-queue ready` now fills in the trial merges and the second-model trail read instead of printing lines to fill. (#4529)
- Five small ship-tool fixes. (#4529)
- A ruling the owner gives while a `/ship` run is open can be relayed. (#4529)
- /ship no longer kills a working test run as stalled when the test command starts its workers in their own session. (#4533)
- /ship no longer stops a review because the state-machine reader started its reply the way its instructions say. (#4504)
- When Claude Code runs /verify right before a commit, it now gets a quick check instead of the full fix loop (GST-3150). (#4508)

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

capy-ai Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Follow-up landed in #4590: gstack-models resolve --role plan-review and list now read a custom Codex provider's config.toml model through the same reader that gstack-codex-probe role-ready uses, so all three agree.

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