fix(ai): update GitHub Copilot extended context windows to 1M
Updates GitHub Copilot built-in model metadata so models with GitHub's extended 1M capability use contextWindow 1000000 in Pi, preventing early compaction and under-budgeting for Claude Opus 4.7/4.8 and GPT-5.3 Codex/5.4/5.5. Verified against raw docs markdown extended-capabilities table and live /models reports. closes #6439
This commit is contained in:
@@ -212,6 +212,20 @@ const OPENCODE_OPENAI_COMPLETIONS_LONG_CACHE_RETENTION_UNSUPPORTED_MODELS = new
|
||||
"opencode-go:kimi-k2.6",
|
||||
]);
|
||||
|
||||
// GitHub's "Models with extended capabilities" table lists these Copilot models as supporting
|
||||
// the extended 1 million token context window.
|
||||
const GITHUB_COPILOT_EXTENDED_CONTEXT_MODELS = new Set([
|
||||
"claude-fable-5",
|
||||
"claude-opus-4.6",
|
||||
"claude-opus-4.7",
|
||||
"claude-opus-4.8",
|
||||
"claude-sonnet-4.6",
|
||||
"claude-sonnet-5",
|
||||
"gpt-5.3-codex",
|
||||
"gpt-5.4",
|
||||
"gpt-5.5",
|
||||
]);
|
||||
|
||||
// Checked manually against the authenticated GitHub Copilot /models endpoint on 2026-06-15.
|
||||
// Keep this to narrow corrections over models.dev metadata instead of snapshotting Copilot's catalog.
|
||||
const GITHUB_COPILOT_THINKING_LEVEL_OVERRIDES = {
|
||||
@@ -1606,11 +1620,14 @@ async function generateModels() {
|
||||
|
||||
// Temporary overrides until upstream model metadata is corrected.
|
||||
for (const candidate of allModels) {
|
||||
if (candidate.provider === "github-copilot" && GITHUB_COPILOT_EXTENDED_CONTEXT_MODELS.has(candidate.id)) {
|
||||
candidate.contextWindow = 1000000;
|
||||
}
|
||||
|
||||
if (
|
||||
(candidate.provider === "anthropic" ||
|
||||
candidate.provider === "opencode" ||
|
||||
candidate.provider === "opencode-go" ||
|
||||
candidate.provider === "github-copilot") &&
|
||||
candidate.provider === "opencode-go") &&
|
||||
(candidate.id === "claude-opus-4-6" ||
|
||||
candidate.id === "claude-sonnet-4-6" ||
|
||||
candidate.id === "claude-opus-4.6" ||
|
||||
|
||||
Reference in New Issue
Block a user