fix: expand Codex model routing to cover ALL Codex models

- Update isCursorModel to exclude ALL Codex models from Cursor routing
- Check against CODEX_MODEL_CONFIG_MAP for comprehensive exclusion
- Includes: gpt-5.2-codex, gpt-5.1-codex-max, gpt-5.1-codex-mini, gpt-5.2, gpt-5.1
- Also excludes overlapping models like gpt-5.2 and gpt-5.1 that exist in both maps
- Update test to expect CodexProvider for gpt-5.2 (correct behavior)

This ensures ALL Codex CLI models route to Codex provider, not Cursor.
Previously only gpt-5.1-codex-* and gpt-5.2-codex-* were excluded.
This commit is contained in:
DhanushSantosh
2026-01-08 23:17:35 +05:30
parent 7583598a05
commit 08ccf2632a
2 changed files with 17 additions and 6 deletions

View File

@@ -129,10 +129,11 @@ describe('provider-factory.ts', () => {
});
describe('Cursor models via model ID lookup', () => {
it('should return CursorProvider for gpt-5.2 (valid Cursor model)', () => {
// gpt-5.2 is in CURSOR_MODEL_MAP
it('should return CodexProvider for gpt-5.2 (Codex model, not Cursor)', () => {
// gpt-5.2 is in both CURSOR_MODEL_MAP and CODEX_MODEL_CONFIG_MAP
// It should route to Codex since Codex models take priority
const provider = ProviderFactory.getProviderForModel('gpt-5.2');
expect(provider).toBeInstanceOf(CursorProvider);
expect(provider).toBeInstanceOf(CodexProvider);
});
it('should return CursorProvider for grok (valid Cursor model)', () => {