diff --git a/docs/plugins/sdk-agent-harness.md b/docs/plugins/sdk-agent-harness.md index c1b5a84c44f..e1b0bf26d6b 100644 --- a/docs/plugins/sdk-agent-harness.md +++ b/docs/plugins/sdk-agent-harness.md @@ -99,9 +99,9 @@ OpenClaw may fall back to PI when the selected plugin harness fails before a turn has produced side effects. Set `OPENCLAW_AGENT_HARNESS_FALLBACK=none` or `embeddedHarness.fallback: "none"` to make that fallback a hard failure instead. -The bundled Codex plugin registers `codex` as its harness id. For compatibility, -`codex-app-server` and `app-server` also resolve to that same harness when you -set `OPENCLAW_AGENT_RUNTIME` manually. +The bundled Codex plugin registers `codex` as its harness id. Core treats that +as an ordinary plugin harness id; Codex-specific aliases belong in the plugin +or operator config, not in the shared runtime selector. ## Provider plus harness pairing diff --git a/extensions/codex/harness.ts b/extensions/codex/harness.ts index aa91b3c6821..c77b357dda3 100644 --- a/extensions/codex/harness.ts +++ b/extensions/codex/harness.ts @@ -10,7 +10,7 @@ import { runCodexAppServerAttempt } from "./src/app-server/run-attempt.js"; import { clearCodexAppServerBinding } from "./src/app-server/session-binding.js"; import { clearSharedCodexAppServerClient } from "./src/app-server/shared-client.js"; -const DEFAULT_CODEX_HARNESS_PROVIDER_IDS = new Set(["codex", "openai-codex"]); +const DEFAULT_CODEX_HARNESS_PROVIDER_IDS = new Set(["codex"]); export type { CodexAppServerListModelsOptions, CodexAppServerModel, CodexAppServerModelListResult }; export { listCodexAppServerModels }; diff --git a/extensions/codex/index.test.ts b/extensions/codex/index.test.ts index 37c405a91c1..d61151c2c8d 100644 --- a/extensions/codex/index.test.ts +++ b/extensions/codex/index.test.ts @@ -1,6 +1,7 @@ import fs from "node:fs"; import { describe, expect, it, vi } from "vitest"; import { createTestPluginApi } from "../../test/helpers/plugins/plugin-api.js"; +import { createCodexAppServerAgentHarness } from "./harness.js"; import plugin from "./index.js"; describe("codex plugin", () => { @@ -42,4 +43,20 @@ describe("codex plugin", () => { description: "Inspect and control the Codex app-server harness", }); }); + + it("only claims the codex provider by default", () => { + const harness = createCodexAppServerAgentHarness(); + + expect( + harness.supports({ provider: "codex", modelId: "gpt-5.4", requestedRuntime: "auto" }) + .supported, + ).toBe(true); + expect( + harness.supports({ + provider: "openai-codex", + modelId: "gpt-5.4", + requestedRuntime: "auto", + }), + ).toMatchObject({ supported: false }); + }); }); diff --git a/src/agents/pi-embedded-runner/run/backend.test.ts b/src/agents/pi-embedded-runner/run/backend.test.ts index e659e555303..a41a85465e5 100644 --- a/src/agents/pi-embedded-runner/run/backend.test.ts +++ b/src/agents/pi-embedded-runner/run/backend.test.ts @@ -10,12 +10,11 @@ describe("resolveEmbeddedAgentRuntime", () => { expect(resolveEmbeddedAgentRuntime({ OPENCLAW_AGENT_RUNTIME: "pi" })).toBe("pi"); }); - it("accepts codex app-server aliases", () => { - expect(resolveEmbeddedAgentRuntime({ OPENCLAW_AGENT_RUNTIME: "codex-app-server" })).toBe( - "codex", - ); + it("preserves plugin harness ids without core-owned aliases", () => { expect(resolveEmbeddedAgentRuntime({ OPENCLAW_AGENT_RUNTIME: "codex" })).toBe("codex"); - expect(resolveEmbeddedAgentRuntime({ OPENCLAW_AGENT_RUNTIME: "app-server" })).toBe("codex"); + expect(resolveEmbeddedAgentRuntime({ OPENCLAW_AGENT_RUNTIME: "codex-app-server" })).toBe( + "codex-app-server", + ); }); it("accepts auto mode", () => { diff --git a/src/agents/pi-embedded-runner/runtime.ts b/src/agents/pi-embedded-runner/runtime.ts index 639d6adc17a..9c85704856c 100644 --- a/src/agents/pi-embedded-runner/runtime.ts +++ b/src/agents/pi-embedded-runner/runtime.ts @@ -9,9 +9,6 @@ export function normalizeEmbeddedAgentRuntime(raw: string | undefined): Embedded if (value === "pi") { return "pi"; } - if (value === "codex" || value === "codex-app-server" || value === "app-server") { - return "codex"; - } if (value === "auto") { return "auto"; }