Skip to content

Commit 4c33aaa

Browse files
authored
refactor: unify OpenAI provider identity (#88451)
* refactor: unify OpenAI provider identity * refactor: move legacy oauth sidecar doctor helpers * test: align OpenAI fixtures after rebase * test: clean OpenAI provider unification * fix: finish OpenAI provider cleanup * fix: finish OpenAI cleanup follow-through * fix: finish OpenAI CI cleanup
1 parent 8d6a6e9 commit 4c33aaa

519 files changed

Lines changed: 4697 additions & 5423 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2871,7 +2871,7 @@ fun providerDisplayName(provider: String): String =
28712871
when (provider.trim().lowercase()) {
28722872
"openai" -> "OpenAI"
28732873
"openrouter" -> "OpenRouter"
2874-
"openai-codex", "codex" -> "Codex"
2874+
"codex" -> "Codex"
28752875
"ollama", "ollama-local" -> "Ollama Local"
28762876
else ->
28772877
provider

apps/android/app/src/main/java/ai/openclaw/app/ui/ProvidersModelsScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ private fun providerPriority(provider: String): Int =
270270
"google" -> 2
271271
"openrouter" -> 3
272272
"ollama", "ollama-local" -> 4
273-
"codex", "openai-codex" -> 5
273+
"codex" -> 5
274274
else -> 100
275275
}
276276

apps/macos/Tests/OpenClawIPCTests/MenuSessionsInjectorTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ struct MenuSessionsInjectorTests {
9797
plan: "Pro",
9898
error: nil),
9999
GatewayUsageProvider(
100-
provider: "openai-codex",
100+
provider: "openai",
101101
displayName: "Codex",
102102
windows: [GatewayUsageWindow(label: "day", usedPercent: 3, resetAt: nil)],
103103
plan: nil,

apps/shared/OpenClawKit/Tests/OpenClawKitTests/ChatViewModelTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ extension TestChatTransportState {
21922192
path: nil,
21932193
count: 1,
21942194
defaults: OpenClawChatSessionsDefaults(
2195-
modelProvider: "openai-codex",
2195+
modelProvider: "openai",
21962196
model: "gpt-5.5",
21972197
contextTokens: nil,
21982198
thinkingLevels: [

docs/cli/migrate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ The bundled Hermes provider detects state at `~/.hermes` by default. Use `--from
236236
- Memory config defaults for OpenClaw file memory, plus archive or manual-review items for external memory providers such as Honcho.
237237
- Skills that include a `SKILL.md` file under `skills/<name>/`.
238238
- Per-skill config values from `skills.config`.
239-
- Supported OAuth credentials from Hermes `auth.json` and OpenCode OpenAI OAuth credentials from OpenCode `auth.json` when interactive credential migration is accepted, or when `--include-secrets` is set.
239+
- OpenCode OpenAI OAuth credentials from OpenCode `auth.json` when interactive credential migration is accepted, or when `--include-secrets` is set. Hermes `auth.json` OAuth entries are legacy state reported for manual OpenAI reauth or doctor repair.
240240
- Supported API keys and tokens from Hermes `.env` and OpenCode `auth.json` when interactive credential migration is accepted, or when `--include-secrets` is set.
241241

242242
### Supported `.env` keys

docs/cli/models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ specific configured agent store. The parent `--agent` flag is honored by
193193
For OpenAI models, `--provider openai` defaults to ChatGPT/Codex account login.
194194
Use `--method api-key` only when you want to add an OpenAI API-key profile,
195195
usually as a backup for Codex subscription limits. Run `openclaw doctor --fix`
196-
to migrate older `openai-codex` auth/profile state to `openai`.
196+
to migrate older legacy OpenAI Codex prefix auth/profile state to `openai`.
197197

198198
Examples:
199199

docs/concepts/agent-runtimes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Most confusion comes from several different surfaces sharing the Codex name:
5858

5959
Those surfaces are intentionally independent. Enabling the `codex` plugin makes
6060
the native app-server features available; `openclaw doctor --fix` owns legacy
61-
`openai-codex/*` route repair and stale session pin cleanup. Selecting
61+
legacy Codex route repair and stale session pin cleanup. Selecting
6262
`openai/*` for an agent model now means "run this through Codex" unless a
6363
non-agent OpenAI API surface is being used.
6464

@@ -97,7 +97,7 @@ This is the agent-facing decision tree:
9797
as `openai/<model>` and set provider/model runtime policy to
9898
`agentRuntime.id: "openclaw"`. A selected `openai` OAuth profile is routed
9999
internally through OpenClaw's Codex-auth transport.
100-
4. If legacy config still contains **`openai-codex/*` model refs**, repair it to
100+
4. If legacy config still contains **legacy Codex model refs**, repair it to
101101
`openai/<model>` with `openclaw doctor --fix`; doctor keeps the Codex auth
102102
route by adding provider/model-scoped `agentRuntime.id: "codex"` where the
103103
old model ref implied it.
@@ -202,7 +202,7 @@ keeping the public model ref as `openai/*`. Stale OpenAI runtime session pins ar
202202
ignored by runtime selection and can be cleaned with `openclaw doctor --fix`.
203203

204204
If `openclaw doctor` warns that the `codex` plugin is enabled while
205-
`openai-codex/*` remains in config, treat that as legacy route state. Run
205+
legacy Codex model refs remain in config, treat that as legacy route state. Run
206206
`openclaw doctor --fix` to rewrite it to `openai/*` with the Codex runtime.
207207

208208
## GitHub Copilot agent runtime

docs/concepts/model-providers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Reference for **LLM/model providers** (not chat channels like WhatsApp/Telegram)
3030
OpenAI-family routes are prefix-specific:
3131

3232
- `openai/<model>` uses the native Codex app-server harness for agent turns by default. This is the usual ChatGPT/Codex subscription setup.
33-
- `openai-codex/<model>` is legacy config that doctor rewrites to `openai/<model>`.
33+
- legacy Codex model refs are legacy config that doctor rewrites to `openai/<model>`.
3434
- `openai/<model>` plus provider/model `agentRuntime.id: "openclaw"` uses OpenClaw's built-in runtime for explicit API-key or compatibility routes.
3535

3636
See [OpenAI](/providers/openai) and [Codex harness](/plugins/codex-harness). If the provider/runtime split is confusing, read [Agent runtimes](/concepts/agent-runtimes) first.
@@ -149,7 +149,7 @@ Anthropic staff told us OpenClaw-style Claude CLI usage is allowed again, so Ope
149149
- Policy note: OpenAI Codex OAuth is explicitly supported for external tools/workflows like OpenClaw.
150150
- For the common subscription plus native Codex runtime route, sign in with `openai` auth and configure `openai/gpt-5.5`; OpenAI agent turns select Codex by default.
151151
- Use provider/model `agentRuntime.id: "openclaw"` only when you want the built-in OpenClaw route; otherwise keep `openai/gpt-5.5` on the default Codex harness.
152-
- `openai-codex/gpt-*` refs remain a legacy OpenAI Codex route. Prefer `openai/gpt-5.5` on the native Codex runtime for new agent config, and run `openclaw doctor --fix` when you want to migrate old `openai-codex/*` refs to canonical `openai/*` refs.
152+
- legacy Codex GPT refs are legacy state, not a live provider route. Use `openai/gpt-5.5` on the native Codex runtime for new agent config, and run `openclaw doctor --fix` to migrate old legacy Codex model refs to canonical `openai/*` refs.
153153

154154
```json5
155155
{

docs/gateway/doctor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ That stages grounded durable candidates into the short-term dreaming store while
414414
- short cooldowns (rate limits/timeouts/auth failures)
415415
- longer disables (billing/credit failures)
416416

417-
Legacy Codex OAuth profiles whose tokens live in macOS Keychain (older onboarding before the file-based sidecar layout) are not picked up by the embedded runtime path — that path runs with `allowKeychainPrompt: false` and cannot trigger a Keychain prompt. Affected users will see a one-shot `log.warn` from the legacy sidecar loader naming `openclaw doctor --fix` and macOS Keychain (instead of the credential silently falling through to a downstream `No API key found for provider "openai-codex"`). Run `openclaw doctor --fix` once from an interactive terminal to migrate Keychain-backed legacy tokens inline into `auth-profiles.json`; after that, embedded turns (Telegram, cron, sub-agent dispatch) resolve them like any other inline OAuth profile.
417+
Legacy Codex OAuth profiles whose tokens live in macOS Keychain (older onboarding before the file-based sidecar layout) are repaired only by doctor. Run `openclaw doctor --fix` once from an interactive terminal to migrate Keychain-backed legacy tokens inline into `auth-profiles.json`; after that, embedded turns (Telegram, cron, sub-agent dispatch) resolve them as canonical OpenAI OAuth profiles.
418418

419419
</Accordion>
420420
<Accordion title="6. Hooks model validation">

docs/help/faq-first-run.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -596,28 +596,28 @@ and troubleshooting see the main [FAQ](/help/faq).
596596
<Accordion title="How does Codex auth work?">
597597
OpenClaw supports **OpenAI Code (Codex)** via OAuth (ChatGPT sign-in). Use
598598
`openai/gpt-5.5` for the common setup: ChatGPT/Codex subscription auth plus
599-
native Codex app-server execution. `openai-codex/gpt-*` model refs are
599+
native Codex app-server execution. Legacy Codex GPT refs are
600600
legacy config repaired by `openclaw doctor --fix`. Direct OpenAI API-key
601601
access remains available for non-agent OpenAI API surfaces and for agent
602602
models through an ordered `openai` API-key profile.
603603
See [Model providers](/concepts/model-providers) and [Onboarding (CLI)](/start/wizard).
604604
</Accordion>
605605

606-
<Accordion title="Why does OpenClaw still mention openai-codex?">
606+
<Accordion title="Why does OpenClaw still mention legacy OpenAI Codex prefix?">
607607
`openai` is the provider and auth-profile id for both OpenAI API keys and
608-
ChatGPT/Codex OAuth. You may still see `openai-codex` in legacy config and
608+
ChatGPT/Codex OAuth. You may still see legacy OpenAI Codex prefix in legacy config and
609609
migration warnings.
610610
Older configs also used it as a model prefix:
611611

612612
- `openai/gpt-5.5` = ChatGPT/Codex subscription auth with native Codex runtime for agent turns
613-
- `openai-codex/gpt-5.5` = legacy model route repaired by `openclaw doctor --fix`
613+
- legacy Codex GPT-5.5 ref = legacy model route repaired by `openclaw doctor --fix`
614614
- `openai/gpt-5.5` plus an ordered `openai` API-key profile = API-key auth for an OpenAI agent model
615-
- `openai-codex:...` = legacy auth profile id migrated by `openclaw doctor --fix`
615+
- legacy Codex auth profile ids = legacy auth profile id migrated by `openclaw doctor --fix`
616616

617617
If you want the direct OpenAI Platform billing/limit path, set
618618
`OPENAI_API_KEY`. If you want ChatGPT/Codex subscription auth, sign in with
619619
`openclaw models auth login --provider openai`. Keep the model ref as
620-
`openai/gpt-5.5`; `openai-codex/*` model refs are legacy config that
620+
`openai/gpt-5.5`; legacy Codex model refs are legacy config that
621621
`openclaw doctor --fix` rewrites.
622622

623623
</Accordion>

0 commit comments

Comments
 (0)