Route OpenAI agents through Codex by default#78899
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. for the review finding: source inspection shows Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Land only after Codex-auth availability is scoped to agent text routes while images, embeddings, speech, realtime, and other non-agent OpenAI surfaces continue to require direct OpenAI API-key auth, with regression coverage for both paths. Do we have a high-confidence way to reproduce the issue? Yes for the review finding: source inspection shows Is this the best way to solve the issue? No: the proposed route normalization is not yet the narrowest maintainable implementation because the status command applies an agent-runtime auth fallback at provider scope. The safer fix is to make Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against e1fec3c892a0. |
5d78c10 to
f17e121
Compare
2016a28 to
db72a6a
Compare
db72a6a to
7d1034c
Compare
* route openai agent runs through codex * fix: load codex plugin for implicit openai runtime * fix: preserve explicit OpenAI PI Codex auth routing * fix: show codex auth for openai model listing * fix: map codex auth into configured openai list rows * fix: preserve explicit openai pi auth routes * docs: keep openai model route examples canonical * fix: clean openai codex test fixtures * fix: scope codex auth status fallback * fix: repair current ci boundary drift
* route openai agent runs through codex * fix: load codex plugin for implicit openai runtime * fix: preserve explicit OpenAI PI Codex auth routing * fix: show codex auth for openai model listing * fix: map codex auth into configured openai list rows * fix: preserve explicit openai pi auth routes * docs: keep openai model route examples canonical * fix: clean openai codex test fixtures * fix: scope codex auth status fallback * fix: repair current ci boundary drift
* route openai agent runs through codex * fix: load codex plugin for implicit openai runtime * fix: preserve explicit OpenAI PI Codex auth routing * fix: show codex auth for openai model listing * fix: map codex auth into configured openai list rows * fix: preserve explicit openai pi auth routes * docs: keep openai model route examples canonical * fix: clean openai codex test fixtures * fix: scope codex auth status fallback * fix: repair current ci boundary drift
* route openai agent runs through codex * fix: load codex plugin for implicit openai runtime * fix: preserve explicit OpenAI PI Codex auth routing * fix: show codex auth for openai model listing * fix: map codex auth into configured openai list rows * fix: preserve explicit openai pi auth routes * docs: keep openai model route examples canonical * fix: clean openai codex test fixtures * fix: scope codex auth status fallback * fix: repair current ci boundary drift
* route openai agent runs through codex * fix: load codex plugin for implicit openai runtime * fix: preserve explicit OpenAI PI Codex auth routing * fix: show codex auth for openai model listing * fix: map codex auth into configured openai list rows * fix: preserve explicit openai pi auth routes * docs: keep openai model route examples canonical * fix: clean openai codex test fixtures * fix: scope codex auth status fallback * fix: repair current ci boundary drift
* route openai agent runs through codex * fix: load codex plugin for implicit openai runtime * fix: preserve explicit OpenAI PI Codex auth routing * fix: show codex auth for openai model listing * fix: map codex auth into configured openai list rows * fix: preserve explicit openai pi auth routes * docs: keep openai model route examples canonical * fix: clean openai codex test fixtures * fix: scope codex auth status fallback * fix: repair current ci boundary drift
Summary
OpenAI-Codex used to be both a public model prefix and the way the old PI path knew to use Codex/ChatGPT auth instead of a plain OpenAI API key. That naming collapsed two different concepts into one label, then became especially confusing once OpenClaw gained the native Codex app-server runtime.
This PR keeps
openai/*as the only public OpenAI model route and makes OpenAI agent turns use the Codex runtime by default when runtime config is omitted or set to auto. Legacyopenai-codex/*model refs are repaired back toopenai/*, whileopenai-codexremains the auth/profile provider for ChatGPT/Codex OAuth and subscription credentials.Explicit PI is still available as an opt-in compatibility route. If a user sets
agentRuntime.id: "pi"and selects anopenai-codexauth profile, OpenClaw keeps the public model ref asopenai/*but routes the PI transport internally through the legacy Codex-auth provider so subscription auth keeps working. NormalopenaiAPI-key profiles still work for explicit PI as before.The Codex plugin is also installed or repaired when users select an OpenAI route that needs the native Codex runtime, so the default path does not depend on a separately installed plugin state.
Real behavior proof
Behavior or issue addressed: A config with canonical
openai/gpt-5.5and only anopenai-codexOAuth profile should be treated as authenticated for OpenAI agent routing.models statusshould not report OpenAI as missing, andmodels listshould show the configured canonical OpenAI row as available through Codex auth.Real environment tested: Local OpenClaw CLI from this branch on macOS, using a throwaway
OPENCLAW_CONFIG_PATHandOPENCLAW_STATE_DIR. The auth profile contained redacted synthetic OAuth token values so no real token was printed or used.Exact steps or command run after this patch: Created a temporary OpenClaw config with
agents.defaults.model.primary = "openai/gpt-5.5"and a temporary main-agentauth-profiles.jsoncontaining onlyopenai-codex:default. Ranopenclaw models status --jsonandopenclaw models list --provider openai --jsonwithOPENAI_API_KEYandOPENAI_OAUTH_TOKENunset.Evidence after fix:
Observed result after fix: The CLI resolved canonical
openai/gpt-5.5with onlyopenai-codexOAuth present.models statusreported no missing provider in use, andmodels listmarked the configuredopenai/gpt-5.5row available.What was not tested: A live paid model inference call with a real ChatGPT/Codex account was not run in this proof; the runtime and auth bridge behavior is covered by the targeted tests and PR CI.