fix(codex): honor configured provider model defaults #8913
ClosedSunkenInTime(GitHub profile, opens in a new tab)wants to merge 4 commits into
main fromrefs/pull/8913/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
SunkenInTime(GitHub profile, opens in a new tab) changed the title
- @@ -247,0 +331,21 @@331+ * tier Codex may silently override.332+ */333+export function applyCodexConfigModelDefaults(334+ models: ReadonlyArray<ServerProviderModel>,335+ config: CodexConfigModelDefaults | null,336+): ReadonlyArray<ServerProviderModel> {337+ const configuredModel = config?.model?.trim();338+ const configuredModelAvailable =339+ configuredModel !== undefined &&340+ configuredModel.length > 0 &&341+ models.some((model) => model.slug === configuredModel);342+ const modelsWithDefault = configuredModelAvailable343+ ? setDefaultModel(models, configuredModel)344+ : applyPreferredCodexDefaultModel(models);345+ const defaultModel = modelsWithDefault.find((model) => model.isDefault)?.slug;346+347+ return modelsWithDefault.map((model) => {348+ const withReasoning = applyConfiguredSelectDefault(349+ model.capabilities,350+ "reasoningEffort",351+ model.slug === defaultModel ? config?.reasoningEffort : undefined,
juliusmarminge closed this
Sign in to join this conversation.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
b40b47ad-7774-4750-9489-f6a3449c7816📥 Commits
Reviewing files that changed from the base of the PR and between ecc6bc89a9c8665cffbd77218e691a42a4ac692b and a59d6d3e628a15d8ed0b020c3814c9f1a58077f5.
📒 Files selected for processing (1)
apps/server/src/provider/Layers/CodexProvider.tsIncluded review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
📝 Walkthrough
Walkthrough#
The change stops storing auto-selected models as project defaults. Auto-bootstrapped threads retain model selection. Migration 44 clears historical implicit Codex defaults. Codex provider probing now applies effective Codex configuration values.
Changes#
Model default handling
apps/server/src/serverRuntimeStartup.ts,apps/server/src/serverRuntimeStartup.test.ts,apps/server/src/cli/project.ts,apps/web/src/components/CommandPalette.tsxdefaultModelSelection: null. Auto-bootstrapped threads receive the selected model. CLI and command-palette project creation use the same behavior.apps/server/src/provider/Layers/CodexProvider.ts,apps/server/src/provider/Layers/CodexProvider.test.ts,docs/user/composer.mdapps/server/src/persistence/Migrations/044_ClearImplicitProjectModelDefaults.ts,apps/server/src/persistence/Migrations/044_ClearImplicitProjectModelDefaults.test.ts,apps/server/src/persistence/Migrations.tsproject.createdevents. Explicit selections remain unchanged.Estimated code review effort: 4 (Complex) | ~45 minutes
Merge Risk: ⚪ Minimal · up to
a59d6The PR restores inherited new-thread defaults and applies effective Codex configuration without any actionable merge-blocking risk remaining.
Sequence Diagram(s)#
Suggested reviewers:
juliusmarminge,gsimone🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.