Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/copilot-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ describe('validateCopilotModel', () => {
expect(result).toEqual({ valid: true, resolvedModel: 'gpt-5.3-codex' });
});

it.each([
'gpt-4.5',
'gpt-5.1',
'claude-fable-5',
'claude-mythos-5',
'claude-sonnet-5',
])('accepts newly supported Copilot allowlist models (%s)', model => {
const result = validateCopilotModel(model);
expect(result).toEqual({ valid: true, resolvedModel: model });
});

it('accepts empty values after trimming', () => {
const result = validateCopilotModel(' ');
expect(result).toEqual({ valid: true, resolvedModel: '' });
Expand Down Expand Up @@ -66,6 +77,7 @@ describe('validateCopilotModel', () => {
return;
}
expect(result.reason).toBe('unsupported');
expect(result.message).toContain('unsupported or unrecognized by this AWF version');
expect(result.message).toContain("Did you mean 'gpt-5.3-codex'?");
});

Expand All @@ -77,7 +89,7 @@ describe('validateCopilotModel', () => {
}
expect(result.reason).toBe('unsupported');
expect(result.message).toBe(
"Error: model 'this-model-does-not-exist-anywhere-12345' is retired or unsupported.",
"Error: model 'this-model-does-not-exist-anywhere-12345' is unsupported or unrecognized by this AWF version.",
);
});
});
9 changes: 7 additions & 2 deletions src/copilot-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ const RETIRED_COPILOT_MODEL_ALIASES: Record<string, string> = {
const SUPPORTED_COPILOT_MODELS = new Set([
'gpt-4',
'gpt-4.1',
'gpt-4.5',
'gpt-4o',
'gpt-4o-mini',
'gpt-5.1',
Comment on lines 30 to +34
'gpt-5.2',
'gpt-5.2-codex',
'gpt-5.3-codex',
Expand All @@ -39,8 +41,11 @@ const SUPPORTED_COPILOT_MODELS = new Set([
'gpt-5-mini',
'o3',
'o3-mini',
'claude-fable-5',
'claude-haiku-4.5',
'claude-mythos-5',
'claude-opus-4.8',
'claude-sonnet-5',
Comment on lines +44 to +48
'claude-sonnet-4.5',
'claude-sonnet-4.6',
'gemini-3.1-pro-preview',
Expand Down Expand Up @@ -120,7 +125,7 @@ export function validateCopilotModel(rawModel: string): CopilotModelValidationRe
valid: false,
reason: 'unsupported',
message: suggested
? `Error: model '${trimmed}' is retired or unsupported. Did you mean '${suggested}'?`
: `Error: model '${trimmed}' is retired or unsupported.`,
? `Error: model '${trimmed}' is unsupported or unrecognized by this AWF version. Did you mean '${suggested}'?`
: `Error: model '${trimmed}' is unsupported or unrecognized by this AWF version.`,
};
}
Loading