Repository navigation
fix(codex): run newly available models through the existing Codex account - #127322
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91b08ee4df
ℹ️ 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".
| ctx.modelProvider?.api === undefined && | ||
| ctx.modelProvider?.baseUrl === undefined && |
There was a problem hiding this comment.
Make the native-account exception reachable
When an explicit Codex run reaches the production selection boundary, buildHarnessModelProvider always sets modelProvider.api and modelProvider.baseUrl from the required Model fields (src/agents/embedded-agent-runner/run/model-harness.ts:74-76, packages/llm-core/src/types.ts:657-663), even when neither value was authored by the operator. Requiring both fields to be undefined therefore makes this exception unreachable: pre-auth selection lacks preparedAuth, finalized selection retains api/baseUrl, and the model is still rejected as having undeclared route compatibility. The new direct supports() test passes only by constructing a context production cannot produce; carry an authored-route fact from the owning producer instead.
AGENTS.md reference: AGENTS.md:L47-L47
Useful? React with 👍 / 👎.
What Problem This Solves
Fixes an issue where users explicitly choosing the Codex runtime cannot use a newly available first-party model until the OpenClaw catalog learns its route, even though their Codex account already supports it.
Why This Change Was Made
The Codex app-server owns its model discovery and authentication. Let its explicitly selected native runtime resolve an unobserved first-party model only when there is no authored endpoint, transport override, forwarded credential, or conflicting provider policy. Automatic runtime selection and existing security boundaries remain unchanged.
User Impact
Newly available Codex models work immediately with an already authenticated native account instead of failing or silently falling back to an older model.
Evidence
280 focused tests pass across Codex harness selection, provider routing, and authentication planning, including explicit coverage for authored endpoints, owner-selected credentials, and automatic selection. Verified the upstream model/list and thread/start contracts in codex-rs/app-server-protocol/src/protocol/v2/model.rs and codex-rs/app-server-protocol/src/protocol/v2/thread.rs.