From b2a213462a5d8a64fdbdfb2e37d6e91a437637c6 Mon Sep 17 00:00:00 2001 From: Filip Stastny Date: Fri, 2 Oct 2026 00:31:12 +0200 Subject: [PATCH 1/2] fix(agents): recognize GPT-6 model variants Route GPT-6.1 and vendor-prefixed deployments through Responses API with large context limits. --- src/agents/plugins/opencode/opencode-dynamic-models.ts | 3 +++ src/agents/plugins/pi/pi.models.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/agents/plugins/opencode/opencode-dynamic-models.ts b/src/agents/plugins/opencode/opencode-dynamic-models.ts index 8381b059b..8e6ab7500 100644 --- a/src/agents/plugins/opencode/opencode-dynamic-models.ts +++ b/src/agents/plugins/opencode/opencode-dynamic-models.ts @@ -45,6 +45,7 @@ const RESPONSES_API_MODEL_PATTERNS: RegExp[] = [ /^gpt-5\.5-/, // gpt-5.5-2026-04-24 — same Azure restriction as gpt-5.4 /^gpt-5-5-/, // hyphenated variant of gpt-5.5-* /gpt-5[.-]6/, // gpt-5.6-* (e.g. openai.gpt-5.6-luna) — same Azure restriction (tools + reasoning_effort) + /gpt-6/, // gpt-6.1, gpt-6-sol and other GPT-6 variants ]; function isResponsesApiModel(id: string): boolean { @@ -57,6 +58,7 @@ function detectFamily(id: string): string { if (id.startsWith('claude')) return 'claude-4'; if (id.startsWith('gemini')) return 'gemini-2'; if (id.startsWith('gpt-4')) return 'gpt-4'; + if (/gpt-6/.test(id)) return 'gpt-6'; if (id.startsWith('gpt-5') || /gpt-5[.-]6/.test(id)) return 'gpt-5'; if (/^o[134]-/.test(id) || id === 'o1') return 'openai-reasoning'; if (id.startsWith('qwen')) return 'qwen3'; @@ -75,6 +77,7 @@ function detectLimits(id: string, family: string): { context: number; output: nu if (family === 'gemini-2' || id.startsWith('gemini')) return { context: 1048576, output: 65536 }; if (id.startsWith('gpt-4.1')) return { context: 1048576, output: 32768 }; if (id.startsWith('gpt-4o')) return { context: 128000, output: 16384 }; + if (/gpt-6/.test(id)) return { context: 1050000, output: 128000 }; // Azure-published window for GPT-6 if (id.startsWith('gpt-5.5') || id.startsWith('gpt-5-5')) return { context: 1050000, output: 128000 }; // Azure-published window for gpt-5.5 if (/gpt-5[.-]6/.test(id)) return { context: 1050000, output: 128000 }; // Azure-published window for gpt-5.6 if (id.startsWith('gpt-5')) return { context: 400000, output: 128000 }; diff --git a/src/agents/plugins/pi/pi.models.ts b/src/agents/plugins/pi/pi.models.ts index 8348de219..5c9a5f0ae 100644 --- a/src/agents/plugins/pi/pi.models.ts +++ b/src/agents/plugins/pi/pi.models.ts @@ -24,6 +24,7 @@ const RESPONSES_API_PATTERNS: RegExp[] = [ /^gpt-5\.5-/, /^gpt-5-5-/, /gpt-5[.-]6/, + /gpt-6/, // gpt-6.1, gpt-6-sol and other GPT-6 variants ]; export function classifyPiModel(modelId: string): PiModelClassification { @@ -67,6 +68,7 @@ function detectLimits(id: string): { contextWindow: number; maxTokens: number } if (id.startsWith('claude')) return { contextWindow: 200000, maxTokens: 64000 }; if (id.startsWith('gemini')) return { contextWindow: 1048576, maxTokens: 65536 }; if (id.startsWith('gpt-4.1')) return { contextWindow: 1048576, maxTokens: 32768 }; + if (/gpt-6/.test(id)) return { contextWindow: 1050000, maxTokens: 128000 }; if (/^gpt-5\.5-/.test(id) || /^gpt-5-5-/.test(id)) return { contextWindow: 1050000, maxTokens: 128000 }; if (/gpt-5[.-]6/.test(id)) return { contextWindow: 1050000, maxTokens: 128000 }; if (id.startsWith('gpt-5')) return { contextWindow: 400000, maxTokens: 128000 }; @@ -95,6 +97,7 @@ function isReasoningModel(id: string): boolean { id.startsWith('claude') || id.startsWith('gemini') || id.startsWith('gpt-5') || + /gpt-6/.test(id) || /gpt-5[.-]6/.test(id) || /^o[134]-/.test(id) || id === 'o1' || From b83e6e9cd2a1b01613961141cf1bb4cbf48c860f Mon Sep 17 00:00:00 2001 From: Filip Stastny Date: Sun, 4 Oct 2026 17:07:54 +0200 Subject: [PATCH 2/2] style(agents): clarify GPT-6 limit detection --- src/agents/plugins/opencode/opencode-dynamic-models.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agents/plugins/opencode/opencode-dynamic-models.ts b/src/agents/plugins/opencode/opencode-dynamic-models.ts index 8e6ab7500..be808dc93 100644 --- a/src/agents/plugins/opencode/opencode-dynamic-models.ts +++ b/src/agents/plugins/opencode/opencode-dynamic-models.ts @@ -77,10 +77,10 @@ function detectLimits(id: string, family: string): { context: number; output: nu if (family === 'gemini-2' || id.startsWith('gemini')) return { context: 1048576, output: 65536 }; if (id.startsWith('gpt-4.1')) return { context: 1048576, output: 32768 }; if (id.startsWith('gpt-4o')) return { context: 128000, output: 16384 }; - if (/gpt-6/.test(id)) return { context: 1050000, output: 128000 }; // Azure-published window for GPT-6 if (id.startsWith('gpt-5.5') || id.startsWith('gpt-5-5')) return { context: 1050000, output: 128000 }; // Azure-published window for gpt-5.5 if (/gpt-5[.-]6/.test(id)) return { context: 1050000, output: 128000 }; // Azure-published window for gpt-5.6 if (id.startsWith('gpt-5')) return { context: 400000, output: 128000 }; + if (/gpt-6/.test(id)) return { context: 1050000, output: 128000 }; // Azure & Bedrock window for GPT-6 if (/^o[134]-/.test(id) || id === 'o1') return { context: 200000, output: 100000 }; if (id.startsWith('qwen') || id.startsWith('moonshotai') || id.startsWith('kimi')) return { context: 262144, output: 131072 }; if (id.startsWith('deepseek')) return { context: 65536, output: 65536 };