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:
@@ -79,19 +79,19 @@ describe("resolveUltraworkOverride", () => {
|
||||
|
||||
test("should resolve override when ultrawork keyword detected", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6", variant: "max" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7", variant: "max" })
|
||||
const output = createOutput("ultrawork do something")
|
||||
|
||||
//#when
|
||||
const result = resolveUltraworkOverride(config, "sisyphus", output)
|
||||
|
||||
//#then
|
||||
expect(result).toEqual({ providerID: "anthropic", modelID: "claude-opus-4-6", variant: "max" })
|
||||
expect(result).toEqual({ providerID: "anthropic", modelID: "claude-opus-4-7", variant: "max" })
|
||||
})
|
||||
|
||||
test("should return null when no keyword detected", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7" })
|
||||
const output = createOutput("just do something normal")
|
||||
|
||||
//#when
|
||||
@@ -103,7 +103,7 @@ describe("resolveUltraworkOverride", () => {
|
||||
|
||||
test("should return null when agent name is undefined", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7" })
|
||||
const output = createOutput("ultrawork do something")
|
||||
|
||||
//#when
|
||||
@@ -115,14 +115,14 @@ describe("resolveUltraworkOverride", () => {
|
||||
|
||||
test("should use message.agent when input agent is undefined", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7" })
|
||||
const output = createOutput("ultrawork do something", "sisyphus")
|
||||
|
||||
//#when
|
||||
const result = resolveUltraworkOverride(config, undefined, output)
|
||||
|
||||
//#then
|
||||
expect(result).toEqual({ providerID: "anthropic", modelID: "claude-opus-4-6", variant: undefined })
|
||||
expect(result).toEqual({ providerID: "anthropic", modelID: "claude-opus-4-7", variant: undefined })
|
||||
})
|
||||
|
||||
test("should return null when agents config is missing", () => {
|
||||
@@ -189,19 +189,19 @@ describe("resolveUltraworkOverride", () => {
|
||||
|
||||
test("should resolve display name to config key", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6", variant: "max" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7", variant: "max" })
|
||||
const output = createOutput("ulw do something")
|
||||
|
||||
//#when
|
||||
const result = resolveUltraworkOverride(config, "Sisyphus - Ultraworker", output)
|
||||
|
||||
//#then
|
||||
expect(result).toEqual({ providerID: "anthropic", modelID: "claude-opus-4-6", variant: "max" })
|
||||
expect(result).toEqual({ providerID: "anthropic", modelID: "claude-opus-4-7", variant: "max" })
|
||||
})
|
||||
|
||||
test("should handle multiple text parts by joining them", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7" })
|
||||
const output = {
|
||||
message: {} as Record<string, unknown>,
|
||||
parts: [
|
||||
@@ -215,12 +215,12 @@ describe("resolveUltraworkOverride", () => {
|
||||
const result = resolveUltraworkOverride(config, "sisyphus", output)
|
||||
|
||||
//#then
|
||||
expect(result).toEqual({ providerID: "anthropic", modelID: "claude-opus-4-6", variant: undefined })
|
||||
expect(result).toEqual({ providerID: "anthropic", modelID: "claude-opus-4-7", variant: undefined })
|
||||
})
|
||||
|
||||
test("should use session agent when input and message agents are undefined", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6", variant: "max" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7", variant: "max" })
|
||||
const output = createOutput("ultrawork do something")
|
||||
const getSessionAgentSpy = spyOn(sessionStateModule, "getSessionAgent")
|
||||
getSessionAgentSpy.mockReturnValue("sisyphus")
|
||||
@@ -230,7 +230,7 @@ describe("resolveUltraworkOverride", () => {
|
||||
|
||||
//#then
|
||||
expect(getSessionAgentSpy).toHaveBeenCalledWith("ses_test")
|
||||
expect(result).toEqual({ providerID: "anthropic", modelID: "claude-opus-4-6", variant: "max" })
|
||||
expect(result).toEqual({ providerID: "anthropic", modelID: "claude-opus-4-7", variant: "max" })
|
||||
|
||||
getSessionAgentSpy.mockRestore()
|
||||
})
|
||||
@@ -287,7 +287,7 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
|
||||
test("should schedule deferred DB override without variant when SDK unavailable", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6", variant: "max" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7", variant: "max" })
|
||||
const output = createOutput("ultrawork do something", { messageId: "msg_123" })
|
||||
const tui = createMockTui()
|
||||
|
||||
@@ -297,7 +297,7 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
//#then - variant should NOT be applied without SDK validation
|
||||
expect(dbOverrideSpy).toHaveBeenCalledWith(
|
||||
"msg_123",
|
||||
{ providerID: "anthropic", modelID: "claude-opus-4-6" },
|
||||
{ providerID: "anthropic", modelID: "claude-opus-4-7" },
|
||||
undefined,
|
||||
)
|
||||
})
|
||||
@@ -305,7 +305,7 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
test("should NOT override variant when SDK unavailable even if config specifies variant", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", {
|
||||
model: "anthropic/claude-opus-4-6",
|
||||
model: "anthropic/claude-opus-4-7",
|
||||
variant: "extended",
|
||||
})
|
||||
const output = createOutput("ultrawork do something", { messageId: "msg_123" })
|
||||
@@ -319,7 +319,7 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
//#then - existing variant preserved, not overridden to "extended"
|
||||
expect(dbOverrideSpy).toHaveBeenCalledWith(
|
||||
"msg_123",
|
||||
{ providerID: "anthropic", modelID: "claude-opus-4-6" },
|
||||
{ providerID: "anthropic", modelID: "claude-opus-4-7" },
|
||||
undefined,
|
||||
)
|
||||
expect(output.message["variant"]).toBe("max")
|
||||
@@ -329,7 +329,7 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
test("should NOT mutate output.message.model when message ID present", () => {
|
||||
//#given
|
||||
const sonnetModel = { providerID: "anthropic", modelID: "claude-sonnet-4-6" }
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7" })
|
||||
const output = createOutput("ultrawork do something", {
|
||||
existingModel: sonnetModel,
|
||||
messageId: "msg_123",
|
||||
@@ -345,7 +345,7 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
|
||||
test("should fall back to direct model mutation without variant when no message ID and no SDK", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6", variant: "max" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7", variant: "max" })
|
||||
const output = createOutput("ultrawork do something")
|
||||
const tui = createMockTui()
|
||||
|
||||
@@ -353,7 +353,7 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
applyUltraworkModelOverrideOnMessage(config, "sisyphus", output, tui)
|
||||
|
||||
//#then - model is set but variant is NOT applied without SDK validation
|
||||
expect(output.message.model).toEqual({ providerID: "anthropic", modelID: "claude-opus-4-6" })
|
||||
expect(output.message.model).toEqual({ providerID: "anthropic", modelID: "claude-opus-4-7" })
|
||||
expect(output.message["variant"]).toBeUndefined()
|
||||
expect(dbOverrideSpy).not.toHaveBeenCalled()
|
||||
})
|
||||
@@ -375,7 +375,7 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
|
||||
test("should not apply override when no keyword detected", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7" })
|
||||
const output = createOutput("just do something normal", { messageId: "msg_123" })
|
||||
const tui = createMockTui()
|
||||
|
||||
@@ -388,7 +388,7 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
|
||||
test("should log the model transition with deferred DB tag", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7" })
|
||||
const existingModel = { providerID: "anthropic", modelID: "claude-sonnet-4-6" }
|
||||
const output = createOutput("ultrawork do something", {
|
||||
existingModel,
|
||||
@@ -408,7 +408,7 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
|
||||
test("should call showToast on override", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7" })
|
||||
const output = createOutput("ultrawork do something", { messageId: "msg_123" })
|
||||
let toastCalled = false
|
||||
const tui = {
|
||||
@@ -426,7 +426,7 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
|
||||
test("should resolve display name to config key with deferred path", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6", variant: "max" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7", variant: "max" })
|
||||
const output = createOutput("ulw do something", { messageId: "msg_123" })
|
||||
const tui = createMockTui()
|
||||
|
||||
@@ -436,16 +436,16 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
//#then
|
||||
expect(dbOverrideSpy).toHaveBeenCalledWith(
|
||||
"msg_123",
|
||||
{ providerID: "anthropic", modelID: "claude-opus-4-6" },
|
||||
{ providerID: "anthropic", modelID: "claude-opus-4-7" },
|
||||
undefined,
|
||||
)
|
||||
})
|
||||
|
||||
test("should skip override trigger when current model already matches ultrawork model", () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6", variant: "max" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7", variant: "max" })
|
||||
const output = createOutput("ultrawork do something", {
|
||||
existingModel: { providerID: "anthropic", modelID: "claude-opus-4-6" },
|
||||
existingModel: { providerID: "anthropic", modelID: "claude-opus-4-7" },
|
||||
messageId: "msg_123",
|
||||
})
|
||||
let toastCalled = false
|
||||
@@ -465,13 +465,13 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
|
||||
test("should apply validated variant when SDK confirms model supports it", async () => {
|
||||
//#given
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-6", variant: "max" })
|
||||
const config = createConfig("sisyphus", { model: "anthropic/claude-opus-4-7", variant: "max" })
|
||||
const output = createOutput("ultrawork do something", { messageId: "msg_123" })
|
||||
const tui = createMockTui()
|
||||
const mockClient = {
|
||||
provider: {
|
||||
list: async () => ({
|
||||
data: { all: [{ id: "anthropic", models: { "claude-opus-4-6": { variants: { max: {} } } } }] },
|
||||
data: { all: [{ id: "anthropic", models: { "claude-opus-4-7": { variants: { max: {} } } } }] },
|
||||
}),
|
||||
},
|
||||
}
|
||||
@@ -482,7 +482,7 @@ describe("applyUltraworkModelOverrideOnMessage", () => {
|
||||
//#then - SDK confirmed max exists, so variant is applied
|
||||
expect(dbOverrideSpy).toHaveBeenCalledWith(
|
||||
"msg_123",
|
||||
{ providerID: "anthropic", modelID: "claude-opus-4-6" },
|
||||
{ providerID: "anthropic", modelID: "claude-opus-4-7" },
|
||||
"max",
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user