Load Codex for selectable OpenAI agent models#81591
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. On current main, an Anthropic-primary config with Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the centralized collector/test change after normal maintainer and CI validation, keeping Codex runtime inference aligned across auto-enable, startup planning, and doctor repair. Do we have a high-confidence way to reproduce the issue? Yes. On current main, an Anthropic-primary config with Is this the best way to solve the issue? Yes. Routing selectable model-map keys through What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against a504cd0190b9. |
|
Landing this one as the canonical fix. Verification checked before merge:
Relevant result: CI/check suites are green; Backport plan: after merge, cherry-pick the resulting squash commit to |
|
Backport complete. Verification for the backport:
Note: the first Testbox attempt used the default |
Treat selectable configured OpenAI agent models as Codex runtime requirements during plugin auto-enable, startup planning, and doctor install repair. PR: openclaw#81591 (cherry picked from commit 3ce9224)
Treat selectable configured OpenAI agent models as Codex runtime requirements during plugin auto-enable, startup planning, and doctor install repair.\n\nPR: openclaw/openclaw#81591
Treat selectable configured OpenAI agent models as Codex runtime requirements during plugin auto-enable, startup planning, and doctor install repair.\n\nPR: openclaw/openclaw#81591
Treat selectable configured OpenAI agent models as Codex runtime requirements during plugin auto-enable, startup planning, and doctor install repair.\n\nPR: openclaw#81591
Treat selectable configured OpenAI agent models as Codex runtime requirements during plugin auto-enable, startup planning, and doctor install repair.\n\nPR: openclaw#81591
Treat selectable configured OpenAI agent models as Codex runtime requirements during plugin auto-enable, startup planning, and doctor install repair.\n\nPR: openclaw#81591
The Codex startup migration already knew that selected OpenAI agent models should run through the Codex harness. The gap was that startup, plugin auto-enable, and doctor repair only looked at the primary/fallback model slots when inferring runtime requirements.
That missed existing configs where Anthropic stayed primary while
agents.defaults.modelsor a per-agentmodelsmap madeopenai/gpt-5.5selectable. Those configs could enable the OpenAI provider but never load or repair the Codex harness, so/model openai/gpt-5.5later resolved to a Codex policy with no registered harness.This change moves selectable agent model-map keys through the same harness policy used for real turns. Official
openai/*selectable agent models now require the Codex plugin, while explicitagentRuntime.id: "pi"and custom OpenAI-compatible base URLs still opt out. The shared helper feeds auto-enable, startup planning, and doctor install repair, so the update path and runtime path agree.I also included a one-line lint cleanup in an untouched live test because the current core lint gate on
origin/mainwas failing on that pre-existing redundant return type before this PR could passpnpm check:changed.Real behavior proof
Behavior addressed: Existing configs with an Anthropic primary model and a selectable
agents.defaults.models["openai/gpt-5.5"]entry should still load and repair the Codex harness before a user switches to that OpenAI model.Real environment tested: Local OpenClaw source checkout in a fresh git worktree, using the real bundled plugin manifest registry, installed plugin index builder, plugin auto-enable code, harness runtime collector, and gateway startup planner.
Exact steps or command run after this patch:
pnpm exec tsx -eimportedcollectConfiguredAgentHarnessRuntimes,applyPluginAutoEnable,loadPluginManifestRegistry,loadInstalledPluginIndex, andresolveGatewayStartupPluginPlanFromRegistry, then evaluated an Anthropic-primary config withagents.defaults.models["openai/gpt-5.5"] = {}.Evidence after fix: The command printed
"configuredRuntimes": ["codex"],"codexEnabled": true, auto-enable changes including"openai/gpt-5.5 model configured, enabled automatically."and"codex agent runtime configured, enabled automatically.", andstartupPluginIdscontaining"codex".Observed result after fix: The local proof shows the same config shape now reaches Codex runtime discovery, plugin auto-enable, and startup planning. Targeted runtime discovery, plugin auto-enable, startup planning, and doctor repair tests also passed, as did targeted
oxfmt,git diff --check, andpnpm check:changed.What was not tested: I did not restart Vincent’s exact gateway or use his private config; the local proof exercises the same startup/doctor discovery path with a redacted minimal config shape.