refactor(model-tests): share template model mock helper

This commit is contained in:
Peter Steinberger 2026-03-17 07:41:00 +00:00
parent 9c1e9c5263
commit 7d90dff8fa

View File

@ -25,14 +25,18 @@ export const OPENAI_CODEX_TEMPLATE_MODEL = {
maxTokens: 128000,
};
export function mockOpenAICodexTemplateModel(): void {
function mockTemplateModel(provider: string, modelId: string, templateModel: unknown): void {
mockDiscoveredModel({
provider: "openai-codex",
modelId: "gpt-5.2-codex",
templateModel: OPENAI_CODEX_TEMPLATE_MODEL,
provider,
modelId,
templateModel,
});
}
export function mockOpenAICodexTemplateModel(): void {
mockTemplateModel("openai-codex", "gpt-5.2-codex", OPENAI_CODEX_TEMPLATE_MODEL);
}
export function buildOpenAICodexForwardCompatExpectation(
id: string = "gpt-5.3-codex",
): Partial<ModelDefinitionConfig> & {
@ -85,19 +89,19 @@ export const GOOGLE_GEMINI_CLI_FLASH_TEMPLATE_MODEL = {
};
export function mockGoogleGeminiCliProTemplateModel(): void {
mockDiscoveredModel({
provider: "google-gemini-cli",
modelId: "gemini-3-pro-preview",
templateModel: GOOGLE_GEMINI_CLI_PRO_TEMPLATE_MODEL,
});
mockTemplateModel(
"google-gemini-cli",
"gemini-3-pro-preview",
GOOGLE_GEMINI_CLI_PRO_TEMPLATE_MODEL,
);
}
export function mockGoogleGeminiCliFlashTemplateModel(): void {
mockDiscoveredModel({
provider: "google-gemini-cli",
modelId: "gemini-3-flash-preview",
templateModel: GOOGLE_GEMINI_CLI_FLASH_TEMPLATE_MODEL,
});
mockTemplateModel(
"google-gemini-cli",
"gemini-3-flash-preview",
GOOGLE_GEMINI_CLI_FLASH_TEMPLATE_MODEL,
);
}
export function resetMockDiscoverModels(): void {