fix: aggressively prune retired model catalogs

This commit is contained in:
Peter Steinberger
2026-05-23 17:29:44 +01:00
parent 7fffbf60b0
commit f4b5e58231
26 changed files with 231 additions and 750 deletions

View File

@@ -34,7 +34,7 @@ import { wrapCopilotProviderStream } from "./stream.js";
const COPILOT_ENV_VARS = ["COPILOT_GITHUB_TOKEN", "GH_TOKEN", "GITHUB_TOKEN"];
const DEFAULT_COPILOT_MODEL = "github-copilot/claude-opus-4.7";
const DEFAULT_COPILOT_PROFILE_ID = "github-copilot:github";
const COPILOT_XHIGH_MODEL_IDS = ["gpt-5.4", "gpt-5.3-codex", "gpt-5.2", "gpt-5.2-codex"] as const;
const COPILOT_XHIGH_MODEL_IDS = ["gpt-5.4", "gpt-5.3-codex"] as const;
type GithubCopilotPluginConfig = {
discovery?: {

View File

@@ -18,10 +18,6 @@ const DEFAULT_MODEL_IDS = [
"gemini-2.5-pro",
"gemini-3-flash",
"gemini-3.1-pro",
"gpt-4.1",
"gpt-5-mini",
"gpt-5.2",
"gpt-5.2-codex",
"gpt-5.3-codex",
"gpt-5.4",
"gpt-5.4-mini",

View File

@@ -148,17 +148,17 @@ describe("resolveCopilotForwardCompatModel", () => {
expect(resolveCopilotForwardCompatModel(ctx)).toBeUndefined();
});
it("clones gpt-5.2-codex template for gpt-5.4", () => {
it("clones gpt-5.3-codex template for gpt-5.4", () => {
const template = {
id: "gpt-5.2-codex",
name: "gpt-5.2-codex",
id: "gpt-5.3-codex",
name: "gpt-5.3-codex",
provider: "github-copilot",
api: "openai-responses",
reasoning: true,
contextWindow: 200_000,
};
const ctx = createMockCtx("gpt-5.4", {
"github-copilot/gpt-5.2-codex": template,
"github-copilot/gpt-5.3-codex": template,
});
const result = requireResolvedModel(ctx);
expect(result.id).toBe("gpt-5.4");
@@ -166,25 +166,15 @@ describe("resolveCopilotForwardCompatModel", () => {
expect((result as unknown as Record<string, unknown>).reasoning).toBe(true);
});
it("clones gpt-5.3-codex template for gpt-5.3-codex when not in registry", () => {
const template = {
id: "gpt-5.2-codex",
name: "gpt-5.2-codex",
provider: "github-copilot",
api: "openai-responses",
reasoning: true,
contextWindow: 200_000,
};
const ctx = createMockCtx("gpt-5.3-codex", {
"github-copilot/gpt-5.2-codex": template,
});
it("uses static metadata for gpt-5.3-codex when not in registry", () => {
const ctx = createMockCtx("gpt-5.3-codex");
const result = requireResolvedModel(ctx);
expect(result.id).toBe("gpt-5.3-codex");
expect(result.name).toBe("gpt-5.3-codex");
expect((result as unknown as Record<string, unknown>).reasoning).toBe(true);
});
it("prefers gpt-5.3-codex as template source over gpt-5.2-codex for gpt-5.4", () => {
it("uses gpt-5.3-codex as the template source for gpt-5.4", () => {
const template53 = {
id: "gpt-5.3-codex",
name: "gpt-5.3-codex",
@@ -193,17 +183,8 @@ describe("resolveCopilotForwardCompatModel", () => {
reasoning: true,
contextWindow: 300_000,
};
const template52 = {
id: "gpt-5.2-codex",
name: "gpt-5.2-codex",
provider: "github-copilot",
api: "openai-responses",
reasoning: true,
contextWindow: 200_000,
};
const ctx = createMockCtx("gpt-5.4", {
"github-copilot/gpt-5.3-codex": template53,
"github-copilot/gpt-5.2-codex": template52,
});
const result = requireResolvedModel(ctx);
expect(result.id).toBe("gpt-5.4");

View File

@@ -17,7 +17,7 @@ export const PROVIDER_ID = "github-copilot";
const CODEX_FORWARD_COMPAT_TARGET_IDS = new Set(["gpt-5.4", "gpt-5.3-codex"]);
// gpt-5.3-codex is only a useful template when gpt-5.4 is the target; it is
// always a registry miss (and therefore skipped) when it is the target itself.
const CODEX_TEMPLATE_MODEL_IDS = ["gpt-5.3-codex", "gpt-5.2-codex"] as const;
const CODEX_TEMPLATE_MODEL_IDS = ["gpt-5.3-codex"] as const;
const DEFAULT_CONTEXT_WINDOW = 128_000;
const DEFAULT_MAX_TOKENS = 8192;

View File

@@ -75,41 +75,6 @@
"maxTokens": 8192,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
},
{
"id": "gpt-4.1",
"name": "GPT-4.1",
"input": ["text", "image"],
"contextWindow": 128000,
"maxTokens": 8192,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
},
{
"id": "gpt-5-mini",
"name": "GPT-5 mini",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 128000,
"maxTokens": 8192,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
},
{
"id": "gpt-5.2",
"name": "GPT-5.2",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 128000,
"maxTokens": 8192,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
},
{
"id": "gpt-5.2-codex",
"name": "GPT-5.2-Codex",
"reasoning": true,
"input": ["text"],
"contextWindow": 128000,
"maxTokens": 8192,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
},
{
"id": "gpt-5.3-codex",
"name": "GPT-5.3-Codex",