test(openai): prefer canonical GPT refs

This commit is contained in:
Peter Steinberger
2026-04-23 20:47:29 +01:00
parent 384eb6bc66
commit ff56a9d41b
16 changed files with 33 additions and 33 deletions

View File

@@ -224,7 +224,7 @@ describe("openai codex provider", () => {
},
},
],
defaultModel: "openai-codex/gpt-5.5",
defaultModel: "openai/gpt-5.5",
});
expect(result?.profiles[0]?.credential).not.toHaveProperty("idToken");
expect(result?.profiles[0]?.credential).not.toHaveProperty("accountId");

View File

@@ -1166,7 +1166,7 @@ describe("qa cli runtime", () => {
it("defaults manual frontier runs onto Codex OAuth when the runtime resolver prefers it", async () => {
defaultQaRuntimeModelForMode.mockImplementation((mode, options) =>
mode === "live-frontier"
? "openai-codex/gpt-5.5"
? "openai/gpt-5.5"
: defaultQaProviderModelForMode(mode as QaProviderModeInput, options),
);
@@ -1179,8 +1179,8 @@ describe("qa cli runtime", () => {
repoRoot: path.resolve("/tmp/openclaw-repo"),
transportId: "qa-channel",
providerMode: "live-frontier",
primaryModel: "openai-codex/gpt-5.5",
alternateModel: "openai-codex/gpt-5.5",
primaryModel: "openai/gpt-5.5",
alternateModel: "openai/gpt-5.5",
fastMode: undefined,
message: "read qa kickoff and reply short",
timeoutMs: undefined,

View File

@@ -43,8 +43,8 @@ describe("qa model selection runtime", () => {
provider === "openai-codex" ? ["openai-codex:user@example.com"] : [],
);
expect(resolveQaPreferredLiveModel()).toBe("openai-codex/gpt-5.5");
expect(defaultQaRuntimeModelForMode("live-frontier")).toBe("openai-codex/gpt-5.5");
expect(resolveQaPreferredLiveModel()).toBe("openai/gpt-5.5");
expect(defaultQaRuntimeModelForMode("live-frontier")).toBe("openai/gpt-5.5");
});
it("keeps the OpenAI live default when stored OpenAI profiles are available", () => {

View File

@@ -4,7 +4,7 @@ import {
} from "openclaw/plugin-sdk/agent-runtime";
import { resolveEnvApiKey } from "openclaw/plugin-sdk/provider-auth";
const QA_CODEX_OAUTH_LIVE_MODEL = "openai-codex/gpt-5.5";
const QA_CODEX_OAUTH_LIVE_MODEL = "openai/gpt-5.5";
export function resolveQaLiveFrontierPreferredModel() {
if (resolveEnvApiKey("openai")?.apiKey) {

View File

@@ -19,7 +19,7 @@ describe("extractQaFailureReplyText", () => {
it("classifies explicit provider auth guidance as a failure", () => {
expect(
extractQaFailureReplyText(
'⚠️ No API key found for provider "openai". You are authenticated with OpenAI Codex OAuth. Use openai-codex/gpt-5.5 (OAuth) or set OPENAI_API_KEY to use openai/gpt-5.5.',
'⚠️ No API key found for provider "openai". You are authenticated with OpenAI Codex OAuth. Use openai/gpt-5.5 with the Codex OAuth profile, or set OPENAI_API_KEY for direct OpenAI API access.',
),
).toContain('No API key found for provider "openai".');
});
@@ -27,7 +27,7 @@ describe("extractQaFailureReplyText", () => {
it("classifies curated missing-key guidance as a failure", () => {
expect(
extractQaFailureReplyText(
"⚠️ Missing API key for OpenAI on the gateway. Use `openai-codex/gpt-5.5` for OAuth, or set `OPENAI_API_KEY`, then try again.",
"⚠️ Missing API key for OpenAI on the gateway. Use `openai/gpt-5.5` with the Codex OAuth profile, or set `OPENAI_API_KEY`, then try again.",
),
).toContain("Missing API key for OpenAI on the gateway.");
});

View File

@@ -99,7 +99,7 @@ describe("qa run config", () => {
});
it("keeps idle snapshots on static defaults so startup does not inspect auth profiles", () => {
defaultQaRuntimeModelForMode.mockReturnValue("openai-codex/gpt-5.5");
defaultQaRuntimeModelForMode.mockReturnValue("openai/gpt-5.5");
defaultQaRuntimeModelForMode.mockClear();
expect(createIdleQaRunnerSnapshot(scenarios).selection).toMatchObject({
@@ -138,14 +138,14 @@ describe("qa run config", () => {
it("prefers the Codex OAuth default when the runtime resolver says it is available", () => {
defaultQaRuntimeModelForMode.mockImplementation((mode, options) =>
mode === "live-frontier"
? "openai-codex/gpt-5.5"
? "openai/gpt-5.5"
: defaultQaProviderModelForMode(mode as QaProviderModeInput, options),
);
expect(createDefaultQaRunSelection(scenarios)).toEqual({
providerMode: "live-frontier",
primaryModel: "openai-codex/gpt-5.5",
alternateModel: "openai-codex/gpt-5.5",
primaryModel: "openai/gpt-5.5",
alternateModel: "openai/gpt-5.5",
fastMode: true,
scenarioIds: ["dm-chat-baseline", "thread-lifecycle"],
});

View File

@@ -35,7 +35,7 @@ describe("qa suite transport helpers", () => {
state.addOutboundMessage({
to: "dm:qa-operator",
text: '⚠️ No API key found for provider "openai". You are authenticated with OpenAI Codex OAuth. Use openai-codex/gpt-5.5 (OAuth) or set OPENAI_API_KEY to use openai/gpt-5.5.',
text: '⚠️ No API key found for provider "openai". You are authenticated with OpenAI Codex OAuth. Use openai/gpt-5.5 with the Codex OAuth profile, or set OPENAI_API_KEY for direct OpenAI API access.',
senderId: "openclaw",
senderName: "OpenClaw QA",
});
@@ -117,7 +117,7 @@ describe("qa suite transport helpers", () => {
state.addOutboundMessage({
to: "dm:qa-operator",
text: '⚠️ No API key found for provider "openai". You are authenticated with OpenAI Codex OAuth. Use openai-codex/gpt-5.5 (OAuth) or set OPENAI_API_KEY to use openai/gpt-5.5.',
text: '⚠️ No API key found for provider "openai". You are authenticated with OpenAI Codex OAuth. Use openai/gpt-5.5 with the Codex OAuth profile, or set OPENAI_API_KEY for direct OpenAI API access.',
senderId: "openclaw",
senderName: "OpenClaw QA",
});
@@ -164,7 +164,7 @@ describe("qa suite transport helpers", () => {
state.addOutboundMessage({
to: "dm:qa-operator",
text: '⚠️ No API key found for provider "openai". You are authenticated with OpenAI Codex OAuth. Use openai-codex/gpt-5.5 (OAuth) or set OPENAI_API_KEY to use openai/gpt-5.5.',
text: '⚠️ No API key found for provider "openai". You are authenticated with OpenAI Codex OAuth. Use openai/gpt-5.5 with the Codex OAuth profile, or set OPENAI_API_KEY for direct OpenAI API access.',
senderId: "openclaw",
senderName: "OpenClaw QA",
});

View File

@@ -117,7 +117,7 @@ vi.mock("../plugins/provider-runtime.js", () => ({
context: { listProfileIds: (providerId: string) => string[] };
}) => {
if (params.provider === "openai" && params.context.listProfileIds("openai-codex").length > 0) {
return 'No API key found for provider "openai". Use openai-codex/gpt-5.5.';
return 'No API key found for provider "openai". Use openai/gpt-5.5.';
}
return undefined;
},
@@ -365,7 +365,7 @@ describe("getApiKeyForModel", () => {
} catch (err) {
error = err;
}
expect(String(error)).toContain("openai-codex/gpt-5.5");
expect(String(error)).toContain("openai/gpt-5.5");
},
);
} finally {

View File

@@ -1517,7 +1517,7 @@ describe("runAgentTurnWithFallback", () => {
it("surfaces direct provider auth guidance for missing API keys", async () => {
state.runEmbeddedPiAgentMock.mockRejectedValueOnce(
new Error(
'No API key found for provider "openai". You are authenticated with OpenAI Codex OAuth. Use openai-codex/gpt-5.5 (OAuth) or set OPENAI_API_KEY to use openai/gpt-5.5. | No API key found for provider "openai". You are authenticated with OpenAI Codex OAuth. Use openai-codex/gpt-5.5 (OAuth) or set OPENAI_API_KEY to use openai/gpt-5.5.',
'No API key found for provider "openai". You are authenticated with OpenAI Codex OAuth. Use openai/gpt-5.5 with the Codex OAuth profile, or set OPENAI_API_KEY for direct OpenAI API access. | No API key found for provider "openai". You are authenticated with OpenAI Codex OAuth. Use openai/gpt-5.5 with the Codex OAuth profile, or set OPENAI_API_KEY for direct OpenAI API access.',
),
);
@@ -1549,7 +1549,7 @@ describe("runAgentTurnWithFallback", () => {
expect(result.kind).toBe("final");
if (result.kind === "final") {
expect(result.payload.text).toBe(
"⚠️ Missing API key for OpenAI on the gateway. Use `openai-codex/gpt-5.5` for OAuth, or set `OPENAI_API_KEY`, then try again.",
"⚠️ Missing API key for OpenAI on the gateway. Use `openai/gpt-5.5` with the Codex OAuth profile, or set `OPENAI_API_KEY`, then try again.",
);
}
});

View File

@@ -298,7 +298,7 @@ describe("modelsAuthLoginCommand", () => {
},
},
],
defaultModel: "openai-codex/gpt-5.5",
defaultModel: "openai/gpt-5.5",
});
mocks.resolvePluginProviders.mockReturnValue([
createProvider({
@@ -365,7 +365,7 @@ describe("modelsAuthLoginCommand", () => {
"Auth profile: openai-codex:user@example.com (openai-codex/oauth)",
);
expect(runtime.log).toHaveBeenCalledWith(
"Default model available: openai-codex/gpt-5.5 (use --set-default to apply)",
"Default model available: openai/gpt-5.5 (use --set-default to apply)",
);
expect(runtime.log).toHaveBeenCalledWith(
"Tip: Codex-capable models can use native Codex web search. Enable it with openclaw configure --section web (recommended mode: cached). Docs: https://docs.openclaw.ai/tools/web",
@@ -585,7 +585,7 @@ describe("modelsAuthLoginCommand", () => {
"anthropic/claude-sonnet-4-6": { alias: "sonnet" },
"anthropic/claude-opus-4-6": { alias: "opus" },
"moonshot/kimi-k2.5": { alias: "kimi" },
"openai-codex/gpt-5.5": { alias: "gpt55" },
"openai/gpt-5.5": { alias: "gpt55" },
};
currentConfig = { agents: { defaults: { models: existingModels } } };
runProviderAuth.mockResolvedValue({
@@ -602,8 +602,8 @@ describe("modelsAuthLoginCommand", () => {
},
},
],
configPatch: { agents: { defaults: { models: { "openai-codex/gpt-5.5": {} } } } },
defaultModel: "openai-codex/gpt-5.5",
configPatch: { agents: { defaults: { models: { "openai/gpt-5.5": {} } } } },
defaultModel: "openai/gpt-5.5",
});
await modelsAuthLoginCommand({ provider: "openai-codex" }, runtime);

View File

@@ -54,7 +54,7 @@ const CODEX_HARNESS_AUTH_MODE =
const describeLive = LIVE && CODEX_HARNESS_LIVE ? describe : describe.skip;
const describeDisabled = LIVE && !CODEX_HARNESS_LIVE ? describe : describe.skip;
const CODEX_HARNESS_TIMEOUT_MS = 900_000;
const DEFAULT_CODEX_MODEL = "codex/gpt-5.4";
const DEFAULT_CODEX_MODEL = "openai/gpt-5.5";
const GATEWAY_CONNECT_TIMEOUT_MS = 60_000;
const CODEX_APP_SERVER_BASE_URL = "https://chatgpt.com/backend-api";
const CODEX_APP_SERVER_CONTEXT_WINDOW = 272_000;

View File

@@ -22,7 +22,7 @@ const describeLive = LIVE && CODEX_HARNESS_LIVE ? describe : describe.skip;
const LIVE_TIMEOUT_MS = 420_000;
const GATEWAY_CONNECT_TIMEOUT_MS = 60_000;
const AGENT_REQUEST_TIMEOUT_MS = 180_000;
const DEFAULT_CODEX_MODEL = "codex/gpt-5.4";
const DEFAULT_CODEX_MODEL = "openai/gpt-5.5";
function logLiveStep(step: string, details?: Record<string, unknown>): void {
if (!CODEX_HARNESS_DEBUG) {

View File

@@ -17,11 +17,11 @@ describe("applyProviderAuthConfigPatch", () => {
};
it("merges default model maps by default so other providers survive login", () => {
const patch = { agents: { defaults: { models: { "openai-codex/gpt-5.5": {} } } } };
const patch = { agents: { defaults: { models: { "openai/gpt-5.5": {} } } } };
const next = applyProviderAuthConfigPatch(base, patch);
expect(next.agents?.defaults?.models).toEqual({
...base.agents.defaults.models,
"openai-codex/gpt-5.5": {},
"openai/gpt-5.5": {},
});
expect(next.agents?.defaults?.model).toEqual(base.agents.defaults.model);
});

View File

@@ -53,7 +53,7 @@ export function expectCodexMissingAuthHint(
listProfileIds: (providerId) => (providerId === "openai-codex" ? ["p1"] : []),
},
}),
).toContain("openai-codex/gpt-5.5");
).toContain("openai/gpt-5.5");
}
export function expectCodexBuiltInSuppression(

View File

@@ -943,7 +943,7 @@ describe("provider-runtime", () => {
{
...createOpenAiCatalogProviderPlugin({
buildMissingAuthMessage: () =>
'No API key found for provider "openai". Use openai-codex/gpt-5.5.',
'No API key found for provider "openai". Use openai/gpt-5.5.',
buildUnknownModelHint,
}),
} as ProviderPlugin,

View File

@@ -119,12 +119,12 @@ function buildOpenAICodexOAuthResult(params: {
agents: {
defaults: {
models: {
"openai-codex/gpt-5.5": {},
"openai/gpt-5.5": {},
},
},
},
},
defaultModel: "openai-codex/gpt-5.5",
defaultModel: "openai/gpt-5.5",
notes: undefined,
};
}