Skip to content

fix(source-control): default Codex to GPT-5.6 Terra low - #24495

Merged
AmethystLiang merged 5 commits into
stablyai:mainfrom
BeamNawapat:fix/codex-commit-config-default
Oct 3, 2026
Merged

AmethystLiang merged 5 commits into
stablyai:mainfrom
BeamNawapat:fix/codex-commit-config-default

Conversation

@BeamNawapat

@BeamNawapat BeamNawapat commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Codex now uses GPT-5.6 Terra with low reasoning effort by default for Source Control AI text generation, replacing the retiring GPT-5.5 default.

What Changed

Added GPT-5.6 Terra to the existing Codex model list with defaultThinkingLevel: 'low' and changed defaultModelId to gpt-5.6-terra. Updated the existing default-model test expectations.

With no saved model choice, generation now passes --model gpt-5.6-terra -c model_reasoning_effort=low. Saved model and effort choices retain the existing behavior.

Why

These actions summarize supplied changes, so Terra with low effort is a suitable smaller-model default. This is a direct model-and-effort update using the existing selection and launch flow. It adds no automatic selection, generation-time discovery, migration, or remote capability negotiation.

Linked Issue

Fixes #24481

Visual Proof

N/A: model metadata and default selection only; no layout or interaction changes. The existing picker gains the Terra entry. No Electron UI check was performed.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

74 tests passed across the agent spec, Source Control AI policy, text-generation settings, and model-discovery suites. Changed files passed oxlint and formatting checks. Full node, CLI, and web typechecks passed.

AI Disclosure

The original PR was authored by an AI agent. This revision was made with Codex at the maintainer's direction.

Review

Agent skill upstream boundary

  • Not applicable; no upstream skill content copied.

Notes

Uses the existing argument-building and host-routing paths for native, WSL, and SSH execution. No provider-specific or wire changes. Existing saved GPT-5.5 selections are preserved. No real Codex generation or SSH integration test was run.

Checklist

  • This PR is small and focused
  • I explained the user-facing change, mechanism, and approach
  • Visual proof marked N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform and remote impact considered
  • Full lint, test, and build suites pass; targeted checks and full typechecks passed

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Changes default AI model selection for commit message generation.

The PR is not yet safe to merge because the remote compatibility gate can use a different repository’s model choice than the server.

Findings

  1. P1 Wrong repository model selected ▶

Summary

The PR makes Codex’s configured model the default for source-control generation and gates that choice on a new remote-server capability. Changes since the previous review add repository-aware compatibility checks, short-form model-flag handling, and default thinking effort.

  • The repository lookup in the compatibility check does not distinguish same-ID rows on different hosts.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Remote generation request] --> B[Client resolves model and repository]
  B --> C{Configured-model sentinel?}
  C -- No --> E[Send generation RPC]
  C -- Yes --> D{Server advertises capability?}
  D -- Yes --> E
  D -- No --> F[Refuse request]
  E --> G[Server resolves repository by worktree host]
Loading

Reviews (2) · Last reviewed commit: "fix(source-control): honor -m, repo over..."

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e251fa2d-9daf-4781-ac86-7e777ec2e0a8
📥 Commits

Reviewing files that changed from the base of the PR and between e4ecacb and 4296c24.

📒 Files selected for processing (4)
  • src/main/text-generation/commit-message-text-generation-settings.test.ts
  • src/shared/commit-message-agent-spec.test.ts
  • src/shared/commit-message-agent-specs-primary.ts
  • src/shared/source-control-ai-policy-regression.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The Codex model list adds GPT-5.6 Terra with a low default thinking level. Codex’s default model changes from GPT-5.5 to GPT-5.6 Terra. Related tests now expect GPT-5.6 Terra for default, fallback, and source-control model resolution.

Fixed issue severity: <fixed_issue_severity>Medium</fixed_issue_severity>

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 4296c

The catalog update has no established merge-blocking defect. Confirm whether selecting Terra explicitly is the intended behavior before release.

Architecture Summary

Architecture risk: 🔵 Low · up to 4296c

The change affects 1 system.

Changed systems: src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 4 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in src/main/text-generation/commit-message-text-generation-settings.test.ts: The fallback test now expects gpt-5.6-terra rather than gpt-5.5 for the undiscovered persisted model.
  • observed — Modified behavior in src/main/text-generation/commit-message-text-generation-settings.test.ts: The default-agent test now expects gpt-5.6-terra rather than gpt-5.5.
  • observed — Modified behavior in src/shared/commit-message-agent-spec.test.ts: The core-agent defaults test is renamed to describe expected defaults, retains Claude’s sonnet and Pi’s default expectations, and changes Codex’s expected default from gpt-5.5 to gpt-5.6-terra; it also checks that this model’s default thinking level is low.
  • observed — Modified behavior in src/shared/commit-message-agent-spec.test.ts: The expected Codex model list now begins with gpt-5.6-terra, ahead of gpt-5.5.
🚥 Pre-merge checks | ✅ 1 | ❌ 4

❌ Failed checks (4 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning [#24481] asks Codex to stop pinning its default to a model slug, using Config default or a live-catalog default. The PR instead sets defaultModelId to the fixed slug gpt-5.6-terra and updates test… Use Config default and omit --model for that selection, or derive the default from the live catalog with the retirement handling described in [#24481]. Add or update tests to cover the selected behavior.
Out of Scope Changes check ⚠️ Warning The new defaultThinkingLevel: 'low' changes Codex reasoning-effort behavior. [#24481] concerns the retiring model default and does not request an effort change; it identifies reasoning-effort catalo… Remove the unrelated default reasoning-effort change, or provide a directly linked requirement for it.
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 10 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description fills the required sections and matches the summarized code changes. However, it conflicts with the stated PR objective, which describes switching to Config default and omitting --mode… Confirm whether the intended change is the GPT-5.6 Terra default or the Config default behavior. Then align the PR objective, description, and implementation details, including the expected model-selection and remote-server behavior.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the changeset: Codex now defaults to GPT-5.6 Terra with low reasoning effort.
Full details: Linked Issues check

Explanation

[#24481] asks Codex to stop pinning its default to a model slug, using Config default or a live-catalog default. The PR instead sets defaultModelId to the fixed slug gpt-5.6-terra and updates tests to assert that value. This replaces the retiring slug but retains the failure mode that the issue identifies. The current description also confirms that generation passes the new slug explicitly when no model is saved.

Full details: Out of Scope Changes check

Explanation

The new defaultThinkingLevel: 'low' changes Codex reasoning-effort behavior. [#24481] concerns the retiring model default and does not request an effort change; it identifies reasoning-effort catalog work as a separate area. The model-list entry supports the model-default change, but the chosen default effort has no demonstrated connection to the linked issue.

Full details: Description check

Explanation

The description fills the required sections and matches the summarized code changes. However, it conflicts with the stated PR objective, which describes switching to Config default and omitting --model rather than defaulting to gpt-5.6-terra.

  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: ce4fe8c0-cfa2-4306-899d-559bb3c30543

📥 Commits

Reviewing files that changed from the base of the PR and between 7577366 and a14509dc63455ebe50d8afa3211fd1a1b09aa029.

📒 Files selected for processing (10)
  • src/main/text-generation/commit-message-text-generation-model-discovery.test.ts
  • src/main/text-generation/commit-message-text-generation-settings.test.ts
  • src/renderer/src/runtime/codex-generation-compatibility.test.ts
  • src/renderer/src/runtime/configured-model-generation-compatibility.ts
  • src/renderer/src/runtime/runtime-git-generation-client.ts
  • src/shared/commit-message-agent-spec.test.ts
  • src/shared/commit-message-agent-specs-primary.ts
  • src/shared/protocol-version.ts
  • src/shared/source-control-ai-policy-regression.test.ts
  • src/shared/source-control-configured-model-capabilities.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one behavior change worth confirming.

Reviewed changes

  • Codex follows its configured model by default — the Codex spec now has a default Config default entry and defaultModelId: 'default'; buildArgs omits --model for the sentinel, matching the Pi/Kimi/Antigravity guards. Explicit models and recipe --model args are unchanged.
  • Remote capability gate generalized — antigravity-generation-compatibility.ts became configured-model-generation-compatibility.ts with a table-driven antigravity + codex mapping. An older host that would build --model default is refused before the RPC; explicit/recipe models bypass the gate.
  • Capability constants extracted — the two configured-model capabilities moved to source-control-configured-model-capabilities.ts and are re-exported from protocol-version.ts; RUNTIME_CAPABILITIES now spreads the pair.
  • Tests — new codex-generation-compatibility.test.ts (old host refuses sentinel with no RPC, capable host sends, explicit + recipe --model bypass), plus updated Codex default expectations in discovery/settings/spec/policy regression tests.

I verified the resolution path checks the static spec before discovery, so the sentinel resolves even though parseCodexModels never returns it; that finalizeModelDiscoveryOutput already preserves a default default; that Orca's managed Codex homes are not a hole (the config mirror copies the user's config.toml, so an omitted --model still lands on the user's configured model or Codex's default); and that branch-name generation is host-local rather than a client-resolved cross-version RPC lane, so it does not need the gate.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

const repoId = getRepoIdFromWorktreeId(worktreeId)
// Why: store slices import the generation client, so a static store import would cycle.
const { useAppStore } = await import('@/store')
return useAppStore.getState().repos.find((repo) => repo.id === repoId) ?? null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Wrong repository model selected When repositories on different hosts share an ID, this lookup takes the first matching row, while the server uses the row for the worktree’s host. On an older server, the gate can therefore send default when the server will reject it, or refuse a request whose repository selects an explicit model.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 163af8b (the branch is also rebased on current main to clear the conflict). findRepoForWorktree no longer takes the first row with a matching id. It reads the repo row for the worktree's own host (worktree.hostId), or for the target runtime (runtime:<env>, the same host that repoWithFetchedOwner stamps on runtime repos). If neither host has a row, the gate applies no repo override instead of borrowing one from another host. New tests: repeated ids across hosts in both orders, and a lone row on another host that is ignored.

Reply written by an AI agent (Claude) on behalf of the PR author.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one host-scoping suggestion inline.

Reviewed changes

  • Restored the low reasoning-effort override for Codex's Config default — the new entry now carries OPENAI_THINKING_LEVELS with defaultThinkingLevel: 'low', so generation cost and latency match the retired pinned default (addresses the prior review).
  • Taught the remote capability gate Codex's -m alias — modelFlags is now per-agent (codex: ['--model', '-m']), matching the spec's singletonOptions, so a recipe using the short form no longer trips the gate.
  • Made the settings-derived gate honor the repo's per-operation model override — it now resolves with repo: findRepoForWorktree(worktreeId), mirroring the server's target.repo.
  • Added coverage — codex-generation-compatibility.test.ts exercises the -m bypass and the repo-override path alongside the existing sentinel/refusal cases; the settings tests assert the restored thinkingLevel: 'low'.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 3ef6b678-1cba-4c33-a74a-86a618c88f3a

📥 Commits

Reviewing files that changed from the base of the PR and between a14509dc63455ebe50d8afa3211fd1a1b09aa029 and 5dc31a357e994f021f739c206d2a5b96c6aeb3f8.

📒 Files selected for processing (4)
  • src/main/text-generation/commit-message-text-generation-settings.test.ts
  • src/renderer/src/runtime/codex-generation-compatibility.test.ts
  • src/renderer/src/runtime/configured-model-generation-compatibility.ts
  • src/shared/commit-message-agent-specs-primary.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Source Control AI pinned Codex to gpt-5.5, which Codex retires on
2026-10-14. Any path that still resolves to that slug would then break
commit-message and PR-field generation.

Follow the Antigravity precedent (stablyai#21606): add a "Config default" entry
for Codex, make it the default, and omit --model when it is selected so
`codex exec` uses the model from the user's Codex config or Codex's own
default. Explicit model choices still pass --model.

Older remote servers would still build `--model default`, so advertise
git.codex-configured-model.v1 and have clients refuse the sentinel for
servers without it, the same way Antigravity is gated. The gate now
covers both agents, and the two capabilities live in their own module
because protocol-version.ts is at the max-lines limit.

Written with AI assistance (Claude Code).

Fixes stablyai#24481
Review on stablyai#24495 found three gaps in the configured-model change.
The remote compatibility gate only recognized --model, so a recipe
passing Codex's -m short flag was rejected on older servers. The gate
also ignored the repository's per-operation model override that the
server applies. And moving Codex to Config default dropped the low
reasoning effort the pinned model used, which would change cost and
latency for users whose Codex config sets a higher effort.
Repo ids can repeat across hosts, so the configured-model gate now reads
the repo row for the worktree's host instead of the first id match, the
same row the server applies. A recipe passing --model default or
-m default no longer counts as an explicit model, since an older server
still forwards that sentinel to the Codex CLI.
@BeamNawapat
BeamNawapat force-pushed the fix/codex-commit-config-default branch from 5dc31a3 to 163af8b Compare October 2, 2026 08:18
A worktree that names its own host must not fall back to the runtime
host's repo row, since the server applies the row for the worktree's
host. Also cover an environment id that needs URL encoding.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Tightened the recipe---model bypass in the configured-model gate: the presence-only hasFlag check is replaced by hasExplicitModelFlag, which only skips the capability check when the value after --model/-m is a real model name. A recipe passing --model default, --model=default, -m default, -mdefault, --model Default, or a flag followed by another option (--model --json) now still goes through the gate, so an older host is never handed the sentinel it rejects.
  • Scoped the gate's repo resolution to the worktree's execution host: findRepoForWorktree(worktreeId, environmentId) resolves through findRepoForHost for the worktree's own host (or the runtime host when the worktree names none), with no cross-host fallback — closing the host-scoping gap flagged on the previous revision.
  • Added coverage: codex-generation-compatibility.test.ts now exercises every rejected sentinel spelling with no RPC, repeated repo ids across hosts in both orders, a lone rival-host row, the worktree's own host, the "do not borrow the runtime row" case, and an environment id requiring URL encoding.

I verified the planner actually leaves --model default in the final argv for a recipe (the singleton-override logic only replaces a generated --model, and the default sentinel omits it), so refusing to bypass on that value is correct. I also confirmed the gate is deliberately stricter than the server, which falls back to a host-blind first-row repo for metadata — the divergence is fail-closed with no under-gating path. Ran the changed-file suites (codex-generation-compatibility, commit-message-agent-spec, settings, discovery, policy-regression): 101 tests pass.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@AmethystLiang AmethystLiang changed the title fix(source-control): use Codex's configured model by default fix(source-control): default Codex to GPT-5.6 Terra low Oct 3, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Codex default pinned to GPT-5.6 Terra with low effort — the Codex spec now tops its model list with gpt-5.6-terra (OPENAI_THINKING_LEVELS, defaultThinkingLevel: 'low') and sets defaultModelId: 'gpt-5.6-terra', replacing the retiring gpt-5.5 default.
  • Configured-model approach reverted — the default sentinel entry, the configuredModelGenerationCompatibilityError gate, the Codex capability constant, and codex-generation-compatibility.test.ts are gone; antigravity-generation-compatibility.ts and the Antigravity capability are restored to their base form.
  • No argv change — Codex buildArgs still passes --model <model> unconditionally on base and head, so the pivot changes only the resolved slug and effort, not the spawn contract.
  • Test expectations updated — the spec, settings-resolution, and policy-regression suites assert the new slug and thinkingLevel: 'low'; discovery coverage keeps its base fallback behavior.

Verified the net base..head delta touches only these 4 files, that no references to the removed CODEX_CONFIGURED_MODEL* / configuredModelGenerationCompatibilityError / source-control-configured-model-capabilities symbols remain, and that the focused suites pass (commit-message-agent-spec, settings, policy-regression, model-discovery: 74 tests; source-control-ai, generation-plan: 34 tests). Prior inline threads are resolved; nothing to retire.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@AmethystLiang
AmethystLiang merged commit 1d010ce into stablyai:main Oct 3, 2026
37 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.

[Bug]: Codex commit-message default is pinned to gpt-5.5, which retires on 2026-10-14

2 participants