fix(onboard): honor openai-codex auth-choice by setting primary model (#33290)#33298
fix(onboard): honor openai-codex auth-choice by setting primary model (#33290)#33298mwfj wants to merge 17 commits intoopenclaw:mainfrom
Conversation
When onboarding explicitly chooses openai-codex, apply the codex primary model directly instead of using the conservative helper that only rewrites openai/* or empty defaults. This avoids silent intent mismatch where auth profile is codex but primary remains anthropic. Also add regression test covering anthropic->openai-codex switch when setDefaultModel=true.
WinnCook
left a comment
There was a problem hiding this comment.
Clean fix — using applyPrimaryModel directly instead of the wrapper is more explicit and avoids the silent no-op that caused the original bug. The before/after comparison via resolveAgentModelPrimaryValue is a nice pattern for gating the "Model configured" note.
Test coverage looks solid — confirms the primary actually changes when setDefaultModel: true is passed with the codex auth choice.
One minor observation: the import reordering in the test file is cosmetic but keeps things tidy. LGTM overall.
|
Thanks @WinnCook — appreciate the detailed review and LGTM.\n\nAgree on the explicit path: this keeps onboarding intent deterministic for , and the note gating via before/after primary comparison avoids noisy messaging.\n\nI also re-checked against project style conventions (existing helper usage, import order, and test structure) and kept the change scoped to the explicit auth-choice path only. |
Greptile SummaryThis PR fixes a silent provider mismatch during openai-codex onboarding by replacing the conservative Key changes:
Confidence Score: 4/5
Last reviewed commit: dd08097 |
Address review feedback: avoid applyPrimaryModel side effect that injects openai-codex into agents.defaults.models. Keep behavior aligned with prior path (primary-only update) while still honoring explicit openai-codex onboarding intent. Add regression assertion that allowlist entry is unchanged.
|
Reviewer note: This PR intentionally updates extension peer dependency specifiers from "openclaw >=2026.3.1" to ">=2026.3.2" in:
and refreshes pnpm-lock.yaml accordingly. Reason: CI secrets job runs pnpm-audit-prod, which was resolving [email protected] via extension peer resolution and failing on advisories patched in 2026.3.2. So this is a deliberate minimum-version floor bump to keep dependency-audit CI green. |
|
Ready for review ✅ (fixes #33290)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0789a29d3a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Update on the recurring secrets CI failure:
Tracking + fix are now split out as requested:
Expect the wait the secrets CI failure fixed by upstream |
|
Ready for review ✅ (fixes #33290) |
|
CI follow-up after conflict resolution:\n\nTwo checks are currently failing, and they appear to be upstream/baseline issues rather than specific to this PR's changes:
Given this, the issue is not introduced by this PR, and we are ready to review |
|
Closing this as stale/superseded by upstream changes. I re-checked main and the underlying onboarding behavior is already covered there in the newer provider-plugin flow:
So the original intent of this PR (making explicit Since this branch is now conflicted and no longer needed to land the fix, closing it. |
Summary
Fixes #33290.
When onboarding explicitly chooses
--auth-choice openai-codex, we should align runtime model selection with that choice. Previously, Codex OAuth credentials were stored but model primary could remain on Anthropic due to conservative default-rewrite rules, causing silent provider-intent mismatch.What changed
src/commands/auth-choice.apply.openai.tsopenai-codexpath withsetDefaultModel=true, set primary directly viaapplyPrimaryModel(..., OPENAI_CODEX_DEFAULT_MODEL)src/commands/auth-choice.test.tsanthropic/claude-sonnet-4-6, choosingopenai-codexwithsetDefaultModel=truenow switches primary toopenai-codex/gpt-5.3-codexNotes
applyOpenAICodexModelDefaultbehavior remains unchanged for other callsites.