Repository navigation
fix: honor Codex auth order for OpenAI PI - #82605
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. Configure Real behavior proof Next step before merge Security Review detailsBest possible solution: Land this PR or an equivalent maintainer-approved fix once it has redacted live proof that documented Do we have a high-confidence way to reproduce the issue? Yes. Configure Is this the best way to solve the issue? Likely yes. The patch moves the PI runtime-provider choice and auth-label ordering to the existing OpenAI/Codex routing helpers with focused regression coverage; maintainer review should confirm the documented What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against b9921e21b93d. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bba9d94e5
ℹ️ 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".
| provider = selectedPiRuntimeProvider; | ||
| modelResolution = runtimeModelResolution; |
There was a problem hiding this comment.
Keep OpenAI config auth lookup on original provider
Switching provider to openai-codex here makes later auth resolution treat the run as Codex-owned, so explicit OpenAI API-key configuration can be skipped. In a PI run with auth.order.openai starting with openai-codex:* and models.providers.openai.auth/apiKey configured, this reassignment causes downstream checks like shouldPreferExplicitConfigApiKeyAuth and key lookup to use openai-codex instead of openai, which can lead to selecting the wrong profile or failing with missing credentials even though OpenAI auth is configured. Keep credential/config resolution keyed to the original OpenAI provider when only the runtime transport changes.
Useful? React with 👍 / 👎.
3bba9d9 to
a2b614a
Compare
|
Landed via rebase onto current main and squash merge.
|
* fix: honor Codex auth order for OpenAI PI * docs: add PR reference for OpenAI PI auth fix
* fix: honor Codex auth order for OpenAI PI * docs: add PR reference for OpenAI PI auth fix
* fix: honor Codex auth order for OpenAI PI * docs: add PR reference for OpenAI PI auth fix
* fix: honor Codex auth order for OpenAI PI * docs: add PR reference for OpenAI PI auth fix
Summary
auth.order.openaientries for explicit OpenAI PI runs while keeping OpenAI-compatible custom base URLs on the OpenAI provider path.openai-codex.openclaw models auth login --provider openai-codex --device-codefor headless Codex OAuth sign-in.Fixes #82521.
Verification
node scripts/run-vitest.mjs src/agents/openai-codex-routing.test.ts src/agents/pi-embedded-runner.e2e.test.ts src/agents/auth-profiles/order.test.ts src/cli/models-cli.test.ts src/auto-reply/reply/commands-status.test.tsgit diff --check/Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --full-accesspnpm check:changedvia Testbox runtbx_01krre2mywy5h4wp2mtwen8z33src/auto-reply/reply/get-reply-directives.tsandsrc/auto-reply/reply/get-reply.tsfor missing image override fieldsReal behavior proof
Behavior addressed: Explicit OpenAI PI runs now respect a Codex-first
auth.order.openailist, soopenai-codex:*OAuth profiles are tried before OpenAI API-key backups when the selected harness is PI.Real environment tested: Local OpenClaw source checkout with focused Vitest coverage plus Codex review; broader
check:changedwas attempted on Testbox and hit unrelated current-main type errors outside this patch.Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/agents/openai-codex-routing.test.ts src/agents/pi-embedded-runner.e2e.test.ts src/agents/auth-profiles/order.test.ts src/cli/models-cli.test.ts src/auto-reply/reply/commands-status.test.tsEvidence after fix: The embedded PI regression test resolves the original OpenAI model config first, then activates the
openai-codexruntime provider only when that runtime model exists, and the status test reports the Codex OAuth profile instead of the OpenAI API-key backup.Observed result after fix: 5 focused test files passed, 71 tests passed; Codex review completed with no accepted/actionable findings remaining.
What was not tested: No live OpenAI/Codex OAuth run was executed in this checkout;
pnpm check:changeddid not complete because of unrelated current-main typecheck failures listed above.