diff --git a/src/agents/models.profiles.live.test.ts b/src/agents/models.profiles.live.test.ts index 81c7a64cb8c..515d2b48ce6 100644 --- a/src/agents/models.profiles.live.test.ts +++ b/src/agents/models.profiles.live.test.ts @@ -11,6 +11,7 @@ import { } from "./live-auth-keys.js"; import { isModernModelRef } from "./live-model-filter.js"; import { getApiKeyForModel, requireApiKey } from "./model-auth.js"; +import { shouldSuppressBuiltInModel } from "./model-suppression.js"; import { ensureOpenClawModelsJson } from "./models-config.js"; import { isRateLimitErrorMessage } from "./pi-embedded-helpers/errors.js"; import { discoverAuthStorage, discoverModels } from "./pi-model-discovery.js"; @@ -202,6 +203,31 @@ function resolveTestReasoning( return "low"; } +function resolveLiveSystemPrompt(model: Model): string | undefined { + if (model.provider === "openai-codex") { + return "You are a concise assistant. Follow the user's instruction exactly."; + } + return undefined; +} + +describe("resolveLiveSystemPrompt", () => { + it("adds instructions for openai-codex probes", () => { + expect( + resolveLiveSystemPrompt({ + provider: "openai-codex", + } as Model), + ).toContain("Follow the user's instruction exactly."); + }); + + it("keeps other providers unchanged", () => { + expect( + resolveLiveSystemPrompt({ + provider: "openai", + } as Model), + ).toBeUndefined(); + }); +}); + async function completeSimpleWithTimeout( model: Model, context: Parameters>[1], @@ -246,6 +272,7 @@ async function completeOkWithRetry(params: { const res = await completeSimpleWithTimeout( params.model, { + systemPrompt: resolveLiveSystemPrompt(params.model), messages: [ { role: "user", @@ -317,6 +344,9 @@ describeLive("live models (profile keys)", () => { }> = []; for (const model of models) { + if (shouldSuppressBuiltInModel({ provider: model.provider, id: model.id })) { + continue; + } if (providers && !providers.has(model.provider)) { continue; }