Repository navigation
fix(openai-codex): default undefined model.api to openai-codex-responses - #66969
saamuelng601-pixel wants to merge 1 commit into
Conversation
normalizeCodexTransport() only converted model.api from "openai-responses" to "openai-codex-responses" when the codex transport was in use, leaving undefined/unset api values to fall through to the default `/chat/completions` endpoint. Cloudflare began issuing managed challenges (403) on that endpoint on 2026-04-14, breaking every openai-codex request that did not explicitly set `api: "openai-responses"` in user config. Widen the condition to also convert when `model.api` is undefined, so the default case ships the request to `/responses` (which CF is not blocking). Users previously working around this by adding explicit `api: "openai-codex-responses"` stanzas in openclaw.json no longer need the override. Refs: openclaw#66633, openclaw#62142, openclaw#62087. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Greptile SummaryThis PR widens the Confidence Score: 5/5Safe to merge — the change is a minimal, well-scoped condition widening with no side-effects on explicit api values or non-Codex base URLs. Single-condition change, logic is correct, early-return and baseUrl derivation remain sound. Only remaining gap is the missing test from the PR's own test plan, which is P2. extensions/openai/openai-codex-provider.test.ts — add a case for normalizeResolvedModel with api: undefined Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/openai/openai-codex-provider.ts
Line: 112-115
Comment:
**Missing test case for the new `undefined` api branch**
The PR description calls out adding a unit case for `undefined model.api`, but `openai-codex-provider.test.ts` only exercises the existing `api: "openai-codex-responses"` path in `normalizeResolvedModel`. A test with `api: undefined` would pin the regression and guard the early-return bypass introduced here.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(openai-codex): default undefined mod..." | Re-trigger Greptile |
| const api = | ||
| useCodexTransport && model.api === "openai-responses" ? "openai-codex-responses" : model.api; | ||
| useCodexTransport && (!model.api || model.api === "openai-responses") | ||
| ? "openai-codex-responses" | ||
| : model.api; |
There was a problem hiding this comment.
Missing test case for the new
undefined api branch
The PR description calls out adding a unit case for undefined model.api, but openai-codex-provider.test.ts only exercises the existing api: "openai-codex-responses" path in normalizeResolvedModel. A test with api: undefined would pin the regression and guard the early-return bypass introduced here.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/openai/openai-codex-provider.ts
Line: 112-115
Comment:
**Missing test case for the new `undefined` api branch**
The PR description calls out adding a unit case for `undefined model.api`, but `openai-codex-provider.test.ts` only exercises the existing `api: "openai-codex-responses"` path in `normalizeResolvedModel`. A test with `api: undefined` would pin the regression and guard the early-return bypass introduced here.
How can I resolve this? If you propose a fix, please make it concise.…nd discovery (#67635) Merged via squash. Supersedes: - #66969 by @saamuelng601-pixel - #67159 by @hclsys Co-authored-by: saamuelng601-pixel <[email protected]> Co-authored-by: hclsys <[email protected]>
|
Thanks for the original fix work here — this was helpful in narrowing down the Codex transport regression. We ended up landing the consolidated follow-up in #67635, which merged the missing- Also credited you in the merged PR / merge commit. Thank you again. |
…nd discovery (openclaw#67635) Merged via squash. Supersedes: - openclaw#66969 by @saamuelng601-pixel - openclaw#67159 by @hclsys Co-authored-by: saamuelng601-pixel <[email protected]> Co-authored-by: hclsys <[email protected]>
…nd discovery (openclaw#67635) Merged via squash. Supersedes: - openclaw#66969 by @saamuelng601-pixel - openclaw#67159 by @hclsys Co-authored-by: saamuelng601-pixel <[email protected]> Co-authored-by: hclsys <[email protected]>
…nd discovery (openclaw#67635) Merged via squash. Supersedes: - openclaw#66969 by @saamuelng601-pixel - openclaw#67159 by @hclsys Co-authored-by: saamuelng601-pixel <[email protected]> Co-authored-by: hclsys <[email protected]>
…nd discovery (openclaw#67635) Merged via squash. Supersedes: - openclaw#66969 by @saamuelng601-pixel - openclaw#67159 by @hclsys Co-authored-by: saamuelng601-pixel <[email protected]> Co-authored-by: hclsys <[email protected]>
…nd discovery (openclaw#67635) Merged via squash. Supersedes: - openclaw#66969 by @saamuelng601-pixel - openclaw#67159 by @hclsys Co-authored-by: saamuelng601-pixel <[email protected]> Co-authored-by: hclsys <[email protected]>
…nd discovery (openclaw#67635) Merged via squash. Supersedes: - openclaw#66969 by @saamuelng601-pixel - openclaw#67159 by @hclsys Co-authored-by: saamuelng601-pixel <[email protected]> Co-authored-by: hclsys <[email protected]>
…nd discovery (openclaw#67635) Merged via squash. Supersedes: - openclaw#66969 by @saamuelng601-pixel - openclaw#67159 by @hclsys Co-authored-by: saamuelng601-pixel <[email protected]> Co-authored-by: hclsys <[email protected]>
…nd discovery (openclaw#67635) Merged via squash. Supersedes: - openclaw#66969 by @saamuelng601-pixel - openclaw#67159 by @hclsys Co-authored-by: saamuelng601-pixel <[email protected]> Co-authored-by: hclsys <[email protected]>
…nd discovery (openclaw#67635) Merged via squash. Supersedes: - openclaw#66969 by @saamuelng601-pixel - openclaw#67159 by @hclsys Co-authored-by: saamuelng601-pixel <[email protected]> Co-authored-by: hclsys <[email protected]>
…nd discovery (openclaw#67635) Merged via squash. Supersedes: - openclaw#66969 by @saamuelng601-pixel - openclaw#67159 by @hclsys Co-authored-by: saamuelng601-pixel <[email protected]> Co-authored-by: hclsys <[email protected]>
…nd discovery (openclaw#67635) Merged via squash. Supersedes: - openclaw#66969 by @saamuelng601-pixel - openclaw#67159 by @hclsys Co-authored-by: saamuelng601-pixel <[email protected]> Co-authored-by: hclsys <[email protected]>
Summary
normalizeCodexTransport()only convertsmodel.apitoopenai-codex-responseswhen the source value is literally"openai-responses"; an undefined / unsetmodel.apifalls through to the default/chat/completionsendpoint./backend-api/codex/chat/completionson 2026-04-14, breaking everyopenai-codexrequest that did not explicitly setapi: "openai-responses"in user config.b90d4ea3d7("fix(codex): canonicalize the gpt-5.4-codex alias"), between 2026.4.11 and 2026.4.14 releases.!model.api, so the default path ships requests to/responses(which CF is not blocking yet) without requiring user-side workarounds.Closes the need for the
openai-codex-responsesoverride stanza documented in #66633.Test plan
model.api)openai-codexoverride) — request should hit/responses, not/chat/completionsmodel.api(e.g.,"openai") is still preserved as-isRelated: #66633, #62142, #62087
🤖 Generated with Claude Code