openclaw/extensions/openai
methazoo 8a2d7f2541 fix(openai-codex): use /backend-api/codex/ base URL
OpenAI removed the /backend-api/responses alias on chatgpt.com server-side.
The OpenAI SDK appends /responses to the configured baseUrl, so OpenClaw's
current baseUrl ("https://chatgpt.com/backend-api") now resolves to
/backend-api/responses and hits a Cloudflare HTML 403 block page. The
provider's 403+HTML error classifier then surfaces this as an auth-scope
failure, triggering fruitless OAuth re-login loops for every GPT-5.4
sub-agent call.

- Point OPENAI_CODEX_BASE_URL at https://chatgpt.com/backend-api/codex
  (both the catalog constant and the sibling local constant in the provider).
- Extend isOpenAICodexBaseUrl to accept the new /codex segment while keeping
  the legacy path recognized so pre-existing user configs and persisted
  model metadata still round-trip through the normalizer correctly.
- Add positive-case test coverage for the new base URL; update existing
  normalization tests whose expected canonical output now includes /codex.

Verified with live curl using the exact OAuth access token stored by
OpenClaw: the /codex/responses path returns HTTP 200 with streaming SSE,
while the old /responses alias returns HTTP 403 HTML regardless of auth
headers. Scoped tests (base-url, openai-codex-provider, transport-policy,
openai-provider, index) pass; pnpm tsgo and pnpm build are clean.
2026-04-21 03:19:58 +01:00
..
test-support test: add missing provider runtime mock export 2026-04-06 18:04:18 +01:00
api.ts test(plugins): fast-path bundled provider contract loads 2026-04-17 14:25:21 -07:00
base-url.test.ts fix(openai-codex): use /backend-api/codex/ base URL 2026-04-21 03:19:58 +01:00
base-url.ts fix(openai-codex): use /backend-api/codex/ base URL 2026-04-21 03:19:58 +01:00
cli-backend.ts refactor(auth): route codex runtimes through canonical oauth 2026-04-18 21:27:27 +01:00
default-models.test.ts refactor: split doctor legacy normalizers and test ownership 2026-04-05 17:17:16 +01:00
default-models.ts Tests: fix package boundary and runtime drift 2026-04-07 14:16:25 +08:00
embedding-batch.ts refactor: move memory embeddings into provider plugins 2026-04-17 02:57:18 +01:00
embedding-provider.ts refactor: move memory embeddings into provider plugins 2026-04-17 02:57:18 +01:00
image-generation-provider.test.ts test: share openai image response fixture 2026-04-20 18:12:43 +01:00
image-generation-provider.ts refactor(lint): reduce map spread patterns 2026-04-18 19:27:43 +01:00
index.test.ts fix(openai): use tagged GPT-5 prompt contract 2026-04-21 02:45:17 +01:00
index.ts refactor: move memory embeddings into provider plugins 2026-04-17 02:57:18 +01:00
media-understanding-provider.test.ts Tests: fix package boundary and runtime drift 2026-04-07 14:16:25 +08:00
media-understanding-provider.ts refactor(media): move provider defaults into media metadata 2026-04-04 07:00:47 +01:00
memory-embedding-adapter.ts refactor: move memory embeddings into provider plugins 2026-04-17 02:57:18 +01:00
openai-codex-auth-identity.test.ts refactor(openai): extract codex auth identity helper 2026-03-25 04:24:46 -07:00
openai-codex-auth-identity.ts refactor: dedupe openai codex string helper 2026-04-06 19:57:57 +01:00
openai-codex-catalog.ts fix(openai-codex): use /backend-api/codex/ base URL 2026-04-21 03:19:58 +01:00
openai-codex-cli-auth.test.ts test: share openai codex cli auth fixture 2026-04-20 21:28:25 +01:00
openai-codex-cli-auth.ts fix: keep codex oauth bridge extension-owned (#68284) (thanks @vincentkoc) 2026-04-18 21:27:27 +01:00
openai-codex-cli-bridge.test.ts fix: keep codex oauth bridge extension-owned (#68284) (thanks @vincentkoc) 2026-04-18 21:27:27 +01:00
openai-codex-cli-bridge.ts refactor: share codex auth bridge 2026-04-21 00:54:08 +01:00
openai-codex-provider.runtime.ts refactor: trim provider oauth runtime seams 2026-03-28 02:08:29 +00:00
openai-codex-provider.test.ts fix(openai-codex): use /backend-api/codex/ base URL 2026-04-21 03:19:58 +01:00
openai-codex-provider.ts fix(openai-codex): use /backend-api/codex/ base URL 2026-04-21 03:19:58 +01:00
openai-codex-shared.ts refactor: dedupe shared string normalizers 2026-04-07 11:18:18 +01:00
openai-provider.live.test.ts test: move openai live smoke to live suite 2026-04-01 02:24:12 +01:00
openai-provider.test.ts fix(openai-codex): use /backend-api/codex/ base URL 2026-04-21 03:19:58 +01:00
openai-provider.ts refactor(openai): import base URL helpers directly 2026-04-14 21:52:16 +05:30
openai.live.test.ts test: stabilize live media and gateway probes 2026-04-21 02:10:19 +01:00
openclaw.plugin.json fix(openai): default GPT-5 prompt overlay 2026-04-21 02:36:16 +01:00
package.json build(deps): declare extension runtime dependencies 2026-04-20 16:07:14 +01:00
plugin-registration.contract.test.ts fix: resolve repo check drift 2026-04-05 22:58:29 +01:00
prompt-overlay.ts fix(openai): use tagged GPT-5 prompt contract 2026-04-21 02:45:17 +01:00
provider-auth.contract.test.ts test(extensions): move provider contracts to owners 2026-04-20 20:55:39 +01:00
provider-catalog.contract.test.ts fix(ci): rename extension test support for boundary guards 2026-03-30 09:31:33 +09:00
provider-contract-api.ts test: use provider contract artifacts 2026-04-18 01:36:15 +01:00
provider-policy-api.ts fix(plugins): stabilize package boundary tsc checks 2026-04-07 10:15:34 +01:00
provider-runtime.contract.test.ts test(extensions): move provider contracts to owners 2026-04-20 20:55:39 +01:00
realtime-provider-shared.ts refactor: share openai realtime close capture 2026-04-20 15:40:12 +01:00
realtime-transcription-provider.test.ts refactor(voice-call): use config for realtime tuning 2026-04-04 12:43:23 +09:00
realtime-transcription-provider.ts refactor: share openai realtime close capture 2026-04-20 15:40:12 +01:00
realtime-voice-provider.test.ts refactor(voice-call): use config for realtime tuning 2026-04-04 12:43:23 +09:00
realtime-voice-provider.ts refactor: share openai realtime close capture 2026-04-20 15:40:12 +01:00
register.runtime.ts Revert "refactor(cli): remove bundled cli text providers" 2026-04-06 13:40:41 +01:00
replay-policy.ts refactor: move provider replay runtime ownership into plugins (#60126) 2026-04-03 23:14:37 +09:00
setup-api.ts test: add cli backend live matrix metadata 2026-04-07 09:06:09 +01:00
shared.ts refactor(openai): import base URL helpers directly 2026-04-14 21:52:16 +05:30
speech-provider.test.ts test: share openai speech fetch fixture 2026-04-20 18:09:29 +01:00
speech-provider.ts refactor: dedupe provider lowercase helpers 2026-04-07 15:53:50 +01:00
test-api.ts test: dedupe media provider tests 2026-04-11 13:55:07 +01:00
transport-policy.test.ts refactor: dedupe openai codex url helper 2026-04-06 19:57:56 +01:00
transport-policy.ts refactor(openai): isolate base URL helpers 2026-04-14 21:45:34 +05:30
tsconfig.json chore(plugins): bulk add package boundary tsconfig rollout 2026-04-07 08:48:23 +01:00
tts.test.ts test: share streaming error response helper 2026-04-21 00:32:42 +01:00
tts.ts feat(msteams): add federated credential support (certificate + managed identity) (#53615) 2026-04-11 13:29:22 -05:00
video-generation-provider.test.ts test: dedupe media provider tests 2026-04-11 13:55:07 +01:00
video-generation-provider.ts refactor: share provider polling helper 2026-04-20 23:04:10 +01:00