refactor(models): bump claude-opus-4-6 to claude-opus-4-7 across fallback chains, categories, and hooks

Updates the canonical Anthropic Opus model in every fallback chain
(sisyphus, oracle, prometheus, metis, momus, visual-engineering,
ultrabrain, deep, artistry, unspecified-high), the unspecified-high
category default, the think-mode HIGH_VARIANT_MAP, the Claude Code
alias map, the claude-thinking legacy alias, the context-limit GA
regex, and event.ts fallback strings.

Widens supportsCachedAnthropicLimit to accept both claude-*-4-6 and
claude-*-4-7 so the 1M context cache still applies across the bump.

Regenerates the bundled model-capabilities snapshot from models.dev
and the model-fallback snapshot to match the new source output.
This commit is contained in:
YeonGyu-Kim
2026-04-17 14:51:52 +09:00
parent b1764a880c
commit def44338ff
85 changed files with 39904 additions and 38116 deletions
@@ -81,7 +81,7 @@ describe("applyAgentConfig .agents skills", () => {
// when
await applyAgentConfig({
config: { model: "anthropic/claude-opus-4-6", agent: {} },
config: { model: "anthropic/claude-opus-4-7", agent: {} },
pluginConfig: createPluginConfig(),
ctx: { directory },
pluginComponents: createPluginComponents(),
@@ -111,7 +111,7 @@ describe("applyAgentConfig .agents skills", () => {
// when
await applyAgentConfig({
config: { model: "anthropic/claude-opus-4-6", agent: {} },
config: { model: "anthropic/claude-opus-4-7", agent: {} },
pluginConfig: createPluginConfig(),
ctx: { directory: "/tmp/project" },
pluginComponents: createPluginComponents(),
@@ -31,7 +31,7 @@ function createPluginComponents(): PluginComponents {
function createBaseConfig(): Record<string, unknown> {
return {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
}
+48 -48
View File
@@ -88,7 +88,7 @@ beforeEach(async () => {
spyOn(mcpModule, "createBuiltinMcps" as any).mockReturnValue({})
spyOn(shared, "log" as any).mockImplementation(() => {})
spyOn(shared, "fetchAvailableModels" as any).mockResolvedValue(new Set(["anthropic/claude-opus-4-6"]))
spyOn(shared, "fetchAvailableModels" as any).mockResolvedValue(new Set(["anthropic/claude-opus-4-7"]))
spyOn(shared, "readConnectedProvidersCache" as any).mockReturnValue(null)
spyOn(configDir, "getOpenCodeConfigPaths" as any).mockReturnValue({
@@ -98,7 +98,7 @@ beforeEach(async () => {
spyOn(permissionCompat, "migrateAgentConfig" as any).mockImplementation((config: Record<string, unknown>) => config)
spyOn(modelResolver, "resolveModelWithFallback" as any).mockReturnValue({ model: "anthropic/claude-opus-4-6" })
spyOn(modelResolver, "resolveModelWithFallback" as any).mockReturnValue({ model: "anthropic/claude-opus-4-7" })
;({ createConfigHandler } = await importFreshConfigHandlerModule())
})
@@ -204,7 +204,7 @@ describe("MCP env allowlist initialization", () => {
mcp_env_allowlist: ["CUSTOM_API_KEY", "CUSTOM_AUTH_TOKEN"],
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -246,7 +246,7 @@ describe("Plan agent demote behavior", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -292,7 +292,7 @@ describe("Plan agent demote behavior", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -336,7 +336,7 @@ describe("Plan agent demote behavior", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -385,7 +385,7 @@ describe("Plan agent demote behavior", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {
plan: {
name: "plan",
@@ -422,7 +422,7 @@ describe("Plan agent demote behavior", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {
plan: {
name: "plan",
@@ -459,7 +459,7 @@ describe("Plan agent demote behavior", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -495,7 +495,7 @@ describe("Agent permission defaults", () => {
})
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -523,7 +523,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
// given
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
default_agent: " hephaestus ",
agent: {},
}
@@ -547,7 +547,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
// given
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
default_agent: "HePhAeStUs",
agent: {},
}
@@ -571,7 +571,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
// #given
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
default_agent: "hephaestus",
agent: {},
}
@@ -596,7 +596,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
const pluginConfig = createPluginConfig({})
const displayName = getAgentListDisplayName("hephaestus")
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
default_agent: displayName,
agent: {},
}
@@ -620,7 +620,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
// #given
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -643,7 +643,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
// given
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
default_agent: "hephaestus",
agent: {},
}
@@ -667,7 +667,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
// given
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
default_agent: " ",
agent: {},
}
@@ -691,7 +691,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
// given
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
default_agent: " Custom Agent ",
agent: {},
}
@@ -719,7 +719,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
default_agent: " HePhAeStUs ",
agent: {},
}
@@ -861,7 +861,7 @@ describe("Prometheus direct override priority over category", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -902,7 +902,7 @@ describe("Prometheus direct override priority over category", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -944,7 +944,7 @@ describe("Prometheus direct override priority over category", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -980,7 +980,7 @@ describe("Prometheus direct override priority over category", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -1007,9 +1007,9 @@ describe("Prometheus direct override priority over category", () => {
describe("Plan agent model inheritance from prometheus", () => {
test("plan agent inherits all model-related settings from resolved prometheus config", async () => {
//#given - prometheus resolves to claude-opus-4-6 with model settings
//#given - prometheus resolves to claude-opus-4-7 with model settings
spyOn(prometheusAgentConfigBuilder, "buildPrometheusAgentConfig").mockResolvedValue({
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
variant: "max",
mode: "primary",
prompt: "prometheus prompt",
@@ -1021,7 +1021,7 @@ describe("Plan agent model inheritance from prometheus", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {
plan: {
name: "plan",
@@ -1047,7 +1047,7 @@ describe("Plan agent model inheritance from prometheus", () => {
const agents = config.agent as Record<string, { mode?: string; model?: string; variant?: string; prompt?: string }>
expect(agents.plan).toBeDefined()
expect(agents.plan.mode).toBe("subagent")
expect(agents.plan.model).toBe("anthropic/claude-opus-4-6")
expect(agents.plan.model).toBe("anthropic/claude-opus-4-7")
expect(agents.plan.variant).toBe("max")
expect(agents.plan.prompt).toBeUndefined()
})
@@ -1078,7 +1078,7 @@ describe("Plan agent model inheritance from prometheus", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -1110,7 +1110,7 @@ describe("Plan agent model inheritance from prometheus", () => {
test("plan agent user override takes priority over prometheus inherited settings", async () => {
//#given - prometheus resolves to opus, but user has plan override for gpt-5.4
spyOn(shared, "resolveModelPipeline" as any).mockReturnValue({
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
provenance: "provider-fallback",
variant: "max",
})
@@ -1128,7 +1128,7 @@ describe("Plan agent model inheritance from prometheus", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -1153,7 +1153,7 @@ describe("Plan agent model inheritance from prometheus", () => {
test("plan agent does NOT inherit prompt, description, or color from prometheus", async () => {
//#given
spyOn(shared, "resolveModelPipeline" as any).mockReturnValue({
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
provenance: "provider-fallback",
variant: "max",
})
@@ -1164,7 +1164,7 @@ describe("Plan agent model inheritance from prometheus", () => {
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -1181,7 +1181,7 @@ describe("Plan agent model inheritance from prometheus", () => {
//#then - plan has model settings but NOT prompt/description/color
const agents = config.agent as Record<string, Record<string, unknown>>
expect(agents.plan.model).toBe("anthropic/claude-opus-4-6")
expect(agents.plan.model).toBe("anthropic/claude-opus-4-7")
expect(agents.plan.prompt).toBeUndefined()
expect(agents.plan.description).toBeUndefined()
expect(agents.plan.color).toBeUndefined()
@@ -1200,7 +1200,7 @@ describe("Deadlock prevention - fetchAvailableModels must not receive client", (
},
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const mockClient = {
@@ -1233,7 +1233,7 @@ describe("config-handler plugin loading error boundary (#1559)", () => {
spyOn(pluginLoader, "loadAllPluginComponents" as any).mockRejectedValue(new Error("crash"))
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const { createConfigHandler: createFreshConfigHandler } = await importFreshConfigHandlerModule()
@@ -1263,7 +1263,7 @@ describe("config-handler plugin loading error boundary (#1559)", () => {
experimental: { plugin_load_timeout_ms: 100 },
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const { createConfigHandler: createFreshConfigHandler } = await importFreshConfigHandlerModule()
@@ -1289,7 +1289,7 @@ describe("config-handler plugin loading error boundary (#1559)", () => {
spyOn(pluginLoader, "loadAllPluginComponents" as any).mockRejectedValue(new Error("crash"))
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const { createConfigHandler: createFreshConfigHandler } = await importFreshConfigHandlerModule()
@@ -1326,7 +1326,7 @@ describe("config-handler plugin loading error boundary (#1559)", () => {
})
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const { createConfigHandler: createFreshConfigHandler } = await importFreshConfigHandlerModule()
@@ -1370,7 +1370,7 @@ describe("command agent routing coherence", () => {
})
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -1420,7 +1420,7 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => {
experimental: { task_system: true },
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -1458,7 +1458,7 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => {
experimental: { task_system: false },
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -1497,7 +1497,7 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => {
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -1538,7 +1538,7 @@ describe("disable_omo_env pass-through", () => {
experimental: { disable_omo_env: true },
})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -1575,7 +1575,7 @@ describe("disable_omo_env pass-through", () => {
const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -1621,7 +1621,7 @@ describe("Agent merge priority — project-local overrides global", () => {
const pluginConfig: OhMyOpenCodeConfig = {}
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -1661,7 +1661,7 @@ describe("Agent merge priority — project-local overrides global", () => {
const pluginConfig: OhMyOpenCodeConfig = {}
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -1701,7 +1701,7 @@ describe("Agent merge priority — project-local overrides global", () => {
const pluginConfig: OhMyOpenCodeConfig = {}
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -1749,7 +1749,7 @@ describe("Agent merge priority — project-local overrides global", () => {
const pluginConfig: OhMyOpenCodeConfig = {}
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
agent: {},
}
const handler = createConfigHandler({
@@ -18,7 +18,7 @@ describe("buildPlanDemoteConfig", () => {
//#given
const prometheusConfig = {
name: "prometheus",
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
variant: "max",
mode: "primary",
prompt: "You are Prometheus...",
@@ -39,7 +39,7 @@ describe("buildPlanDemoteConfig", () => {
//#then - picks model settings, NOT prompt/permission/description/color/name/mode
expect(result.mode).toBe("subagent")
expect(result.model).toBe("anthropic/claude-opus-4-6")
expect(result.model).toBe("anthropic/claude-opus-4-7")
expect(result.variant).toBe("max")
expect(result.temperature).toBe(0.1)
expect(result.top_p).toBe(0.95)
@@ -58,7 +58,7 @@ describe("buildPlanDemoteConfig", () => {
test("plan override takes priority over prometheus for all model settings", () => {
//#given
const prometheusConfig = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
variant: "max",
temperature: 0.1,
reasoningEffort: "high",
@@ -83,7 +83,7 @@ describe("buildPlanDemoteConfig", () => {
test("falls back to prometheus when plan override has partial settings", () => {
//#given
const prometheusConfig = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
variant: "max",
temperature: 0.1,
reasoningEffort: "high",
@@ -105,14 +105,14 @@ describe("buildPlanDemoteConfig", () => {
test("skips undefined values from both sources", () => {
//#given
const prometheusConfig = {
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
}
//#when
const result = buildPlanDemoteConfig(prometheusConfig, undefined)
//#then
expect(result).toEqual({ mode: "subagent", hidden: true, model: "anthropic/claude-opus-4-6" })
expect(result).toEqual({ mode: "subagent", hidden: true, model: "anthropic/claude-opus-4-7" })
expect(Object.keys(result)).toEqual(["mode", "hidden", "model"])
})
})
@@ -24,7 +24,7 @@ describe("buildPrometheusAgentConfig", () => {
(category) => ({ model: `${category}/default-model` } as CategoryConfig)
);
resolveModelPipelineSpy = spyOn(shared, "resolveModelPipeline").mockReturnValue({
model: "anthropic/claude-opus-4-6",
model: "anthropic/claude-opus-4-7",
provenance: "provider-fallback",
});
;({ buildPrometheusAgentConfig } = await importFreshPrometheusAgentConfigBuilderModule())
@@ -42,7 +42,7 @@ describe("buildPrometheusAgentConfig", () => {
describe("#when currentModel is NOT in Prometheus fallback chain", () => {
test("falls through to fallback chain instead of using currentModel as override", async () => {
// given - currentModel is a model NOT in Prometheus fallback chain
// Prometheus chain: claude-opus-4-6, gpt-5.4, glm-5, gemini-3.1-pro
// Prometheus chain: claude-opus-4-7, gpt-5.4, glm-5, gemini-3.1-pro
const currentModel = "some-provider/gpt-5.3-codex";
// when
@@ -65,14 +65,14 @@ describe("buildPrometheusAgentConfig", () => {
systemDefaultModel: undefined,
}),
});
expect(result.model).toBe("anthropic/claude-opus-4-6");
expect(result.model).toBe("anthropic/claude-opus-4-7");
});
});
describe("#when currentModel IS in Prometheus fallback chain", () => {
test("preserves currentModel as uiSelectedModel for claude-opus-4-6", async () => {
test("preserves currentModel as uiSelectedModel for claude-opus-4-7", async () => {
// given - currentModel matches a Prometheus fallback chain entry
const currentModel = "anthropic/claude-opus-4-6";
const currentModel = "anthropic/claude-opus-4-7";
// when - should not throw and should produce a valid config
const result = await buildPrometheusAgentConfig({
@@ -128,7 +128,7 @@ describe("buildPrometheusAgentConfig", () => {
describe("#given explicit Prometheus model configured via plugin override", () => {
test("explicit config wins over currentModel and fallback chain", async () => {
// given
const currentModel = "anthropic/claude-opus-4-6";
const currentModel = "anthropic/claude-opus-4-7";
const explicitModel = "custom-provider/custom-model";
// when
@@ -163,7 +163,7 @@ describe("buildPrometheusAgentConfig", () => {
describe("#given category with model configured", () => {
test("category model wins when no explicit override", async () => {
// given
const currentModel = "anthropic/claude-opus-4-6";
const currentModel = "anthropic/claude-opus-4-7";
const categoryModel = "category-provider/category-model";
resolveCategoryConfigSpy.mockReturnValue({
@@ -264,7 +264,7 @@ describe("buildPrometheusAgentConfig", () => {
},
})
);
expect(result.model).toBe("anthropic/claude-opus-4-6");
expect(result.model).toBe("anthropic/claude-opus-4-7");
});
});