feat(ai): openai-codex-responses support use custom apiKey and baseUrl#4667
feat(ai): openai-codex-responses support use custom apiKey and baseUrl#4667CyJaySong wants to merge 2 commits into
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
roboomp
left a comment
There was a problem hiding this comment.
P3: the feature is scoped to Codex Responses custom gateways, but the diff is currently broken/off-contract.
Headline blockers: packages/ai changed tests fail (bun --cwd=packages/ai test test/openai-codex-stream.test.ts: 53 pass / 4 fail); the new metadata helper does not implement the project/projectless workspace contract; and the opaque-key beta-header contract is now inconsistent across old and new coverage. Also needs changelog entries for the user-facing packages/ai and packages/coding-agent changes.
Thanks for pushing the gateway path forward; once the failing contracts are reconciled, this should be much easier to judge on the intended behavior.
What
Add support for API-key based custom providers on the OpenAI Codex Responses path.
This change lets custom
openai-codex-responsesproviders use bearer API keys while preserving the first-party Codex request shape, including Codex-style response metadata, cache-related headers, and the existing OMPoriginator/User-Agentbehavior.Why
Some Codex-compatible gateways route requests correctly only when the request follows the Codex Responses API contract closely. API-key based custom providers previously could not fully use that path, which made these gateways fall back to unintended model routing.
Testing
bun --cwd=packages/ai run checkgit diff --checkbun checkpasses