diff --git a/src/agents/auth-profiles/order.test.ts b/src/agents/auth-profiles/order.test.ts index cc7a99195c7..04f8f7269bd 100644 --- a/src/agents/auth-profiles/order.test.ts +++ b/src/agents/auth-profiles/order.test.ts @@ -305,7 +305,7 @@ describe("resolveAuthProfileOrder", () => { expect(order).toEqual([]); }); - it("preserves native Codex profiles before OpenAI alias API-key order", async () => { + it("respects friendly OpenAI alias API-key order when Codex auth is selected", async () => { const store: AuthProfileStore = { version: 1, profiles: { @@ -336,7 +336,7 @@ describe("resolveAuthProfileOrder", () => { provider: "openai-codex", }); - expect(order).toEqual(["openai-codex:personal", "openai:default"]); + expect(order).toEqual(["openai:default"]); }); it("keeps Codex profiles listed in the friendly OpenAI order for Codex auth", async () => { diff --git a/src/agents/embedded-agent-runner.e2e.test.ts b/src/agents/embedded-agent-runner.e2e.test.ts index 6ab532eea2d..8c88c0b2200 100644 --- a/src/agents/embedded-agent-runner.e2e.test.ts +++ b/src/agents/embedded-agent-runner.e2e.test.ts @@ -373,9 +373,8 @@ describe("runEmbeddedPiAgent", () => { expect(ensureOpenClawModelCatalogMock).not.toHaveBeenCalled(); }); - it("resolves explicit OpenAI OpenClaw runs through Codex when auth order starts with Codex OAuth", async () => { - const sessionFile = nextSessionFile(); - const baseConfig = createEmbeddedAgentRunnerOpenAiConfig(["mock-1"]); + it("resolves explicit OpenAI PI runs through Codex when auth order starts with Codex OAuth", async () => { + const baseConfig = createEmbeddedPiRunnerOpenAiConfig(["mock-1"]); const openAIProvider = baseConfig.models?.providers?.openai; if (!openAIProvider) { throw new Error("expected OpenAI provider test config"); @@ -414,9 +413,8 @@ describe("runEmbeddedPiAgent", () => { }), ); - await runEmbeddedAgent({ - sessionId: "codex-first-openclaw", - sessionFile, + await runEmbeddedPiAgent({ + sessionId: "codex-first-pi", workspaceDir, config: cfg, prompt: "hello", diff --git a/src/agents/embedded-agent-runner/run.ts b/src/agents/embedded-agent-runner/run.ts index 416f3a8bec3..10bd531b31c 100644 --- a/src/agents/embedded-agent-runner/run.ts +++ b/src/agents/embedded-agent-runner/run.ts @@ -88,7 +88,6 @@ import { shouldPreferExplicitConfigApiKeyAuth, } from "../model-auth.js"; import { ensureOpenClawModelCatalog } from "../models-config.js"; -import { resolveContextConfigProviderForRuntime } from "../openai-codex-routing.js"; import { OPENAI_CODEX_PROVIDER_ID, listOpenAIAuthProfileProvidersForAgentRuntime,