Skip to content
Open
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
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ The main entry point orchestrates a **7-step fetch flow**:
- All `gpt-5.1-codex-mini*` variants → `gpt-5.1-codex-mini`
- All `gpt-5.2` variants → `gpt-5.2`
- All `gpt-5.1` variants → `gpt-5.1`
- **Newer models** (`gpt-5.3+`, `gpt-6+`) pass through unchanged (lowercased), so new releases work without a code change
- **Legacy mappings** (GPT-5.0 being phased out):
- `gpt-5-codex*` variants → `gpt-5.1-codex`
- `gpt-5-codex-mini*` or `codex-mini-latest` → `gpt-5.1-codex-mini`
Expand Down
5 changes: 5 additions & 0 deletions lib/request/request-transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export function normalizeModel(model: string | undefined): string {
return mappedModel;
}

// Newer models (gpt-5.3+, gpt-6+) pass through unchanged
if (/^gpt-(5\.([3-9]|\d{2,})|[6-9]|[1-9]\d)/i.test(modelId)) {
return modelId.toLowerCase();
}

// Fallback: Pattern-based matching for unknown/custom model names
// This preserves backwards compatibility with old verbose names
// like "GPT 5 Codex Low (ChatGPT Subscription)"
Expand Down
18 changes: 18 additions & 0 deletions test/request-transformer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ describe('Request Transformer Module', () => {
expect(normalizeModel('gpt-5')).toBe('gpt-5.1');
});

it('should pass through gpt-5.3+ model names unchanged', async () => {
expect(normalizeModel('gpt-5.5')).toBe('gpt-5.5');
expect(normalizeModel('GPT-5.5')).toBe('gpt-5.5');
expect(normalizeModel('gpt-5.6-luna')).toBe('gpt-5.6-luna');
});

it('should pass through gpt-6+ model names unchanged', async () => {
expect(normalizeModel('gpt-6-astra')).toBe('gpt-6-astra');
expect(normalizeModel('gpt-10')).toBe('gpt-10');
expect(normalizeModel('GPT-10-Astra')).toBe('gpt-10-astra');
});

it('should keep mapping legacy names after newer-model passthrough', async () => {
expect(normalizeModel('gpt-5.2')).toBe('gpt-5.2');
expect(normalizeModel('gpt-5.1-codex-max')).toBe('gpt-5.1-codex-max');
expect(normalizeModel('gpt-5-codex')).toBe('gpt-5.1-codex');
});

it('should normalize variants containing "codex" to gpt-5.1-codex', async () => {
expect(normalizeModel('openai/gpt-5-codex')).toBe('gpt-5.1-codex');
expect(normalizeModel('custom-gpt-5-codex-variant')).toBe('gpt-5.1-codex');
Expand Down