From 1d010ce2f8b0db1c731bbd696dd940ceb20a02be Mon Sep 17 00:00:00 2001 From: Nawapat Buakoet Date: Sun, 4 Oct 2026 00:14:05 +0700 Subject: [PATCH] fix(source-control): default Codex to GPT-5.6 Terra low (#24495) * fix(source-control): use Codex's configured model by default 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 (#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 #24481 * fix(source-control): honor -m, repo overrides and low effort for Codex Review on #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. * fix(source-control): match gate repo and model checks to the server 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. * fix(source-control): read only the worktree host's repo row in the gate 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. * fix(source-control): default Codex to GPT-5.6 Terra low --------- Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com> --- .../commit-message-text-generation-settings.test.ts | 4 ++-- src/shared/commit-message-agent-spec.test.ts | 8 +++++--- src/shared/commit-message-agent-specs-primary.ts | 8 +++++++- src/shared/source-control-ai-policy-regression.test.ts | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/text-generation/commit-message-text-generation-settings.test.ts b/src/main/text-generation/commit-message-text-generation-settings.test.ts index b7640a33d72..e40514409bc 100644 --- a/src/main/text-generation/commit-message-text-generation-settings.test.ts +++ b/src/main/text-generation/commit-message-text-generation-settings.test.ts @@ -27,7 +27,7 @@ describe('resolveCommitMessageSettings', () => { ok: true, params: { agentId: 'codex', - model: 'gpt-5.5', + model: 'gpt-5.6-terra', thinkingLevel: 'low', customPrompt: 'Use Conventional Commits.', commandInputTemplate: '{basePrompt}\n\nUse Conventional Commits.' @@ -69,7 +69,7 @@ describe('resolveCommitMessageSettings', () => { ok: true, params: { agentId: 'codex', - model: 'gpt-5.5', + model: 'gpt-5.6-terra', thinkingLevel: 'low' } }) diff --git a/src/shared/commit-message-agent-spec.test.ts b/src/shared/commit-message-agent-spec.test.ts index 68d1ffc79bc..18635420b4c 100644 --- a/src/shared/commit-message-agent-spec.test.ts +++ b/src/shared/commit-message-agent-spec.test.ts @@ -45,9 +45,10 @@ describe('COMMIT_MESSAGE_AGENT_SPECS', () => { ]) }) - it('uses the strongest available defaults for core agents', () => { + it('uses the expected defaults for core agents', () => { expect(COMMIT_MESSAGE_AGENT_SPECS.claude?.defaultModelId).toBe('sonnet') - expect(COMMIT_MESSAGE_AGENT_SPECS.codex?.defaultModelId).toBe('gpt-5.5') + expect(COMMIT_MESSAGE_AGENT_SPECS.codex?.defaultModelId).toBe('gpt-5.6-terra') + expect(getCommitMessageModel('codex', 'gpt-5.6-terra')?.defaultThinkingLevel).toBe('low') expect(COMMIT_MESSAGE_AGENT_SPECS.pi?.defaultModelId).toBe('default') }) @@ -189,6 +190,7 @@ describe('COMMIT_MESSAGE_AGENT_SPECS', () => { it('orders Codex models by version descending to match the official picker', () => { const ids = COMMIT_MESSAGE_AGENT_SPECS.codex?.models.map((m) => m.id) expect(ids).toEqual([ + 'gpt-5.6-terra', 'gpt-5.5', 'gpt-5.4', 'gpt-5.4-mini', @@ -206,7 +208,7 @@ describe('COMMIT_MESSAGE_AGENT_SPECS', () => { id: 'codex', label: 'Codex', modelSource: 'dynamic', - defaultModelId: 'gpt-5.5' + defaultModelId: 'gpt-5.6-terra' }) expect(codex).not.toHaveProperty('binary') expect(codex).not.toHaveProperty('buildArgs') diff --git a/src/shared/commit-message-agent-specs-primary.ts b/src/shared/commit-message-agent-specs-primary.ts index ce7b35afcfb..7a2aa70c979 100644 --- a/src/shared/commit-message-agent-specs-primary.ts +++ b/src/shared/commit-message-agent-specs-primary.ts @@ -109,6 +109,12 @@ export function buildPrimaryCommitMessageAgentSpecs({ // Why: ordered to match the official `codex` model picker — descending // by version so the frontier model lands on top and legacy models trail. models: [ + { + id: 'gpt-5.6-terra', + label: 'GPT-5.6 Terra', + thinkingLevels: OPENAI_THINKING_LEVELS, + defaultThinkingLevel: 'low' + }, { id: 'gpt-5.5', label: 'GPT-5.5', @@ -150,7 +156,7 @@ export function buildPrimaryCommitMessageAgentSpecs({ defaultThinkingLevel: 'low' } ], - defaultModelId: 'gpt-5.5' + defaultModelId: 'gpt-5.6-terra' }, opencode: { id: 'opencode', diff --git a/src/shared/source-control-ai-policy-regression.test.ts b/src/shared/source-control-ai-policy-regression.test.ts index c8cb6bd75ab..49261e68bf0 100644 --- a/src/shared/source-control-ai-policy-regression.test.ts +++ b/src/shared/source-control-ai-policy-regression.test.ts @@ -21,7 +21,7 @@ describe('source-control AI policy regressions', () => { expect(result).toMatchObject({ ok: true, - value: { params: { agentId: 'codex', model: 'gpt-5.5' } } + value: { params: { agentId: 'codex', model: 'gpt-5.6-terra' } } }) })