


























@@ -104,6 +104,22 @@ describe("github-copilot model defaults", () => {
104104});
105105});
106106107+it("uses static metadata overrides for Claude Opus 1M fallback rows", () => {
108+const def = buildCopilotModelDefinition("claude-opus-4.7-1m-internal");
109+expect(def).toEqual({
110+id: "claude-opus-4.7-1m-internal",
111+name: "Claude Opus 4.7 (1M context)",
112+api: "anthropic-messages",
113+reasoning: true,
114+input: ["text", "image"],
115+cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
116+contextWindow: 1_000_000,
117+maxTokens: 64_000,
118+thinkingLevelMap: { xhigh: "xhigh" },
119+compat: { supportedReasoningEfforts: ["low", "medium", "high", "xhigh"] },
120+});
121+});
122+107123it("trims whitespace from model id", () => {
108124const def = buildCopilotModelDefinition(" gpt-4o ");
109125expect(def.id).toBe("gpt-4o");
@@ -205,6 +221,14 @@ describe("resolveCopilotForwardCompatModel", () => {
205221});
206222});
207223224+it("preserves static Anthropic thinking maps for Claude Opus 1M fallback rows", () => {
225+const result = requireResolvedModel(createMockCtx("claude-opus-4.7-1m-internal"));
226+expect(result.thinkingLevelMap).toEqual({ xhigh: "xhigh" });
227+expect(result.compat).toEqual({
228+supportedReasoningEfforts: ["low", "medium", "high", "xhigh"],
229+});
230+});
231+208232it("creates synthetic model for arbitrary unknown model ID", () => {
209233const ctx = createMockCtx("gpt-5.4-mini");
210234const result = requireResolvedModel(ctx);
@@ -476,7 +500,11 @@ describe("fetchCopilotModelCatalog", () => {
476500max_context_window_tokens: 1000000,
477501max_output_tokens: 64000,
478502},
479-supports: { vision: true, tool_calls: true },
503+supports: {
504+vision: true,
505+tool_calls: true,
506+reasoning_effort: ["low", "medium", "high", "xhigh"],
507+},
480508},
481509},
482510{
@@ -540,6 +568,7 @@ describe("fetchCopilotModelCatalog", () => {
540568cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
541569contextWindow: 400000,
542570maxTokens: 128000,
571+compat: { supportedReasoningEfforts: ["low", "medium", "high"] },
543572});
544573545574const codex = out.find((m) => m.id === "gpt-5.3-codex");
@@ -559,6 +588,10 @@ describe("fetchCopilotModelCatalog", () => {
559588const opus1m = out.find((m) => m.id === "claude-opus-4.7-1m-internal");
560589expect(opus1m?.api).toBe("anthropic-messages");
561590expect(opus1m?.contextWindow).toBe(1_000_000);
591+expect(opus1m?.thinkingLevelMap).toEqual({ xhigh: "xhigh" });
592+expect(opus1m?.compat).toEqual({
593+supportedReasoningEfforts: ["low", "medium", "high", "xhigh"],
594+});
562595});
563596564597it("strips trailing slash from baseUrl when building the /models URL", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。