

















@@ -87,9 +87,10 @@ If your config uses `plugins.allow`, include `codex` there too:
8787}
8888```
898990-Do not use `openai-codex/gpt-*` when you mean native Codex runtime. That prefix
91-is the explicit "Codex OAuth through PI" route. Config changes apply to new or
92-reset sessions; existing sessions keep their recorded runtime.
90+Do not use `openai-codex/gpt-*` in config. That prefix is a legacy route that
91+`openclaw doctor --fix` rewrites to `openai/gpt-*` across primary models,
92+fallbacks, heartbeat/subagent/compaction overrides, hooks, channel overrides,
93+and stale persisted session route pins.
93949495## What this plugin changes
9596@@ -106,7 +107,9 @@ The bundled `codex` plugin contributes several separate capabilities:
106107Enabling the plugin makes those capabilities available. It does **not**:
107108108109- start using Codex for every OpenAI model
109-- convert `openai-codex/*` model refs into the native runtime
110+- convert `openai-codex/*` model refs into the native runtime without doctor
111+ verifying that Codex is installed, enabled, contributes the `codex` harness,
112+ and is OAuth-ready
110113- make ACP/acpx the default Codex path
111114- hot-switch existing sessions that already recorded a PI runtime
112115- replace OpenClaw channel delivery, session files, auth-profile storage, or
@@ -145,10 +148,10 @@ want native app-server execution. Legacy `codex/*` model refs still auto-select
145148the harness for compatibility, but runtime-backed legacy provider prefixes are
146149not shown as normal model/provider choices.
147150148-If the `codex` plugin is enabled but the primary model is still
149-`openai-codex/*`, `openclaw doctor` warns instead of changing the route. That is
150-intentional: `openai-codex/*` remains the PI Codex OAuth/subscription path, and
151-native app-server execution stays an explicit runtime choice.
151+If any configured model route is still `openai-codex/*`, `openclaw doctor --fix`
152+rewrites it to `openai/*`. For matching agent routes, it sets the agent runtime
153+to `codex` only when the Codex plugin is installed, enabled, contributes the
154+`codex` harness, and has usable OAuth; otherwise it sets the runtime to `pi`.
152155153156## Route map
154157@@ -158,15 +161,18 @@ Use this table before changing config:
158161| ---------------------------------------------------- | -------------------------- | -------------------------------------- | ---------------------------- | ------------------------------ |
159162| ChatGPT/Codex subscription with native Codex runtime | `openai/gpt-*` | `agentRuntime.id: "codex"` | Codex OAuth or Codex account | `Runtime: OpenAI Codex` |
160163| OpenAI API through normal OpenClaw runner | `openai/gpt-*` | omitted or `runtime: "pi"` | OpenAI API key | `Runtime: OpenClaw Pi Default` |
161-| ChatGPT/Codex subscription through PI | `openai-codex/gpt-*` | omitted or `runtime: "pi"` | OpenAI Codex OAuth provider | `Runtime: OpenClaw Pi Default` |
164+| Legacy config that needs doctor repair | `openai-codex/gpt-*` | repaired to `codex` or `pi` | Existing configured auth | Recheck after `doctor --fix` |
162165| Mixed providers with conservative auto mode | provider-specific refs | `agentRuntime.id: "auto"` | Per selected provider | Depends on selected runtime |
163166| Explicit Codex ACP adapter session | ACP prompt/model dependent | `sessions_spawn` with `runtime: "acp"` | ACP backend auth | ACP task/session status |
164167165168The important split is provider versus runtime:
166169167-- `openai-codex/*` answers "which provider/auth route should PI use?"
168-- `agentRuntime.id: "codex"` answers "which loop should execute this
169- embedded turn?"
170+- `openai-codex/*` is a legacy route that doctor rewrites.
171+- `agentRuntime.id: "codex"` requires the Codex harness and fails closed if it
172+ is unavailable.
173+- `agentRuntime.id: "auto"` lets registered harnesses claim matching provider
174+ routes, but canonical OpenAI refs are still PI-owned unless a harness supports
175+ that provider/model pair.
170176- `/codex ...` answers "which native Codex conversation should this chat bind
171177 or control?"
172178- ACP answers "which external harness process should acpx launch?"
@@ -175,33 +181,30 @@ The important split is provider versus runtime:
175181176182OpenAI-family routes are prefix-specific. For the common subscription plus
177183native Codex runtime setup, use `openai/*` with `agentRuntime.id: "codex"`.
178-Use `openai-codex/*` only when you intentionally want Codex OAuth through PI:
184+Treat `openai-codex/*` as legacy config that doctor should rewrite:
179185180186| Model ref | Runtime path | Use when |
181187| --------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------- |
182188| `openai/gpt-5.4` | OpenAI provider through OpenClaw/PI plumbing | You want current direct OpenAI Platform API access with `OPENAI_API_KEY`. |
183-| `openai-codex/gpt-5.5` | OpenAI Codex OAuth through OpenClaw/PI | You want ChatGPT/Codex subscription auth with the default PI runner. |
189+| `openai-codex/gpt-5.5` | Legacy route repaired by doctor | You are on old config; run `openclaw doctor --fix` to rewrite it. |
184190| `openai/gpt-5.5` + `agentRuntime.id: "codex"` | Codex app-server harness | You want ChatGPT/Codex subscription auth with native Codex execution. |
185191186192GPT-5.5 can appear on both direct OpenAI API-key and Codex subscription routes
187193when your account exposes them. Use `openai/gpt-5.5` with the Codex app-server
188-harness for native Codex runtime, `openai-codex/gpt-5.5` for PI OAuth, or
189-`openai/gpt-5.5` without a Codex runtime override for direct API-key traffic.
194+harness for native Codex runtime, or `openai/gpt-5.5` without a Codex runtime
195+override for direct API-key traffic.
190196191197Legacy `codex/gpt-*` refs remain accepted as compatibility aliases. Doctor
192-compatibility migration rewrites legacy primary runtime refs to canonical model
193-refs and records the runtime policy separately, while fallback-only legacy refs
194-are left unchanged because runtime is configured for the whole agent container.
195-New PI Codex OAuth configs should use `openai-codex/gpt-*`; new native
196-app-server harness configs should use `openai/gpt-*` plus
197-`agentRuntime.id: "codex"`.
198+compatibility migration rewrites legacy runtime refs to canonical model refs
199+and records the runtime policy separately. New native app-server harness configs
200+should use `openai/gpt-*` plus `agentRuntime.id: "codex"`.
198201199202`agents.defaults.imageModel` follows the same prefix split. Use
200-`openai-codex/gpt-*` when image understanding should run through the OpenAI
201-Codex OAuth provider path. Use `codex/gpt-*` when image understanding should run
202-through a bounded Codex app-server turn. The Codex app-server model must
203-advertise image input support; text-only Codex models fail before the media turn
204-starts.
203+`openai/gpt-*` for the normal OpenAI route and `codex/gpt-*` when image
204+understanding should run through a bounded Codex app-server turn. Do not use
205+`openai-codex/gpt-*`; doctor rewrites that legacy prefix to `openai/gpt-*`. The
206+Codex app-server model must advertise image input support; text-only Codex
207+models fail before the media turn starts.
205208206209Use `/status` to confirm the effective harness for the current session. If the
207210selection is surprising, enable debug logging for the `agents/harness` subsystem
@@ -211,22 +214,20 @@ in `auto` mode, each plugin candidate's support result.
211214212215### What doctor warnings mean
213216214-`openclaw doctor` warns when all of these are true:
217+`openclaw doctor` warns when configured model refs or persisted session route
218+state still use `openai-codex/*`. `openclaw doctor --fix` rewrites those routes
219+to:
215220216-- the bundled `codex` plugin is enabled or allowed
217-- an agent's primary model is `openai-codex/*`
218-- that agent's effective runtime is not `codex`
221+- `openai/<model>`
222+- `agentRuntime.id: "codex"` when Codex is installed, enabled, contributes the
223+`codex` harness, and has usable OAuth
224+- `agentRuntime.id: "pi"` otherwise
219225220-That warning exists because users often expect "Codex plugin enabled" to imply
221-"native Codex app-server runtime." OpenClaw does not make that leap. The warning
222-means:
223-224-- **No change is required** if you intended ChatGPT/Codex OAuth through PI.
225-- Change the model to `openai/<model>` and set
226-`agentRuntime.id: "codex"` if you intended native app-server
227- execution.
228-- Existing sessions still need `/new` or `/reset` after a runtime change,
229- because session runtime pins are sticky.
226+The `codex` route forces the native Codex harness. The `pi` route keeps the
227+agent on the default OpenClaw runner instead of enabling or installing Codex as
228+a side effect of legacy-route cleanup.
229+Doctor also repairs stale persisted session pins across discovered agent session
230+stores so old conversations do not stay wedged on the removed route.
230231231232Harness selection is not a live session control. When an embedded turn runs,
232233OpenClaw records the selected harness id on that session and keeps using it for
@@ -349,7 +350,7 @@ Agents should route user requests by intent, not by the word "Codex" alone:
349350| "File a support report for a bad Codex run" | `/diagnostics [note]` |
350351| "Only send Codex feedback for this attached thread" | `/codex diagnostics [note]` |
351352| "Use my ChatGPT/Codex subscription with Codex runtime" | `openai/*` plus `agentRuntime.id: "codex"` |
352-| "Use my ChatGPT/Codex subscription through PI" | `openai-codex/*` model refs |
353+| "Repair old `openai-codex/*` config/session pins" | `openclaw doctor --fix` |
353354| "Run Codex through ACP/acpx" | ACP `sessions_spawn({ runtime: "acp", ... })` |
354355| "Start Claude Code/Gemini/OpenCode/Cursor in a thread" | ACP/acpx, not `/codex` and not native sub-agents |
355356此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。