chore: upgrade claude-sonnet-4-5 to claude-sonnet-4-6 across codebase

This commit is contained in:
YeonGyu-Kim
2026-02-18 15:51:24 +09:00
parent 6a4d86b86a
commit 8ea24d26d2
46 changed files with 201 additions and 200 deletions
@@ -4,11 +4,11 @@ import type { PluginInput } from "@opencode-ai/plugin"
const executeCompactMock = mock(async () => {})
const getLastAssistantMock = mock(async () => ({
providerID: "anthropic",
modelID: "claude-sonnet-4-5",
modelID: "claude-sonnet-4-6",
}))
const parseAnthropicTokenLimitErrorMock = mock(() => ({
providerID: "anthropic",
modelID: "claude-sonnet-4-5",
modelID: "claude-sonnet-4-6",
}))
mock.module("./executor", () => ({
+2 -2
View File
@@ -144,10 +144,10 @@ describe("createAnthropicEffortHook", () => {
})
it("should NOT inject effort for non-opus model", async () => {
//#given claude-sonnet-4-5 (not opus)
//#given claude-sonnet-4-6 (not opus)
const hook = createAnthropicEffortHook()
const { input, output } = createMockParams({
modelID: "claude-sonnet-4-5",
modelID: "claude-sonnet-4-6",
})
//#when chat.params hook is called
+2 -2
View File
@@ -21,7 +21,7 @@ function createMockInput(sessionID: string, messageID?: string): AutoSlashComman
sessionID,
messageID: messageID ?? `msg-${Date.now()}-${Math.random()}`,
agent: "test-agent",
model: { providerID: "anthropic", modelID: "claude-sonnet-4-5" },
model: { providerID: "anthropic", modelID: "claude-sonnet-4-6" },
}
}
@@ -29,7 +29,7 @@ function createMockOutput(text: string): AutoSlashCommandHookOutput {
return {
message: {
agent: "test-agent",
model: { providerID: "anthropic", modelID: "claude-sonnet-4-5" },
model: { providerID: "anthropic", modelID: "claude-sonnet-4-6" },
path: { cwd: "/test", root: "/test" },
tools: {},
},
+7 -7
View File
@@ -75,7 +75,7 @@ describe("preemptive-compaction", () => {
role: "assistant",
sessionID,
providerID: "anthropic",
modelID: "claude-sonnet-4-5",
modelID: "claude-sonnet-4-6",
finish: true,
tokens: {
input: 50000,
@@ -128,7 +128,7 @@ describe("preemptive-compaction", () => {
role: "assistant",
sessionID,
providerID: "anthropic",
modelID: "claude-sonnet-4-5",
modelID: "claude-sonnet-4-6",
finish: true,
tokens: {
input: 170000,
@@ -164,7 +164,7 @@ describe("preemptive-compaction", () => {
role: "assistant",
sessionID,
providerID: "google-vertex-anthropic",
modelID: "claude-sonnet-4-5",
modelID: "claude-sonnet-4-6",
finish: true,
tokens: {
input: 170000,
@@ -202,7 +202,7 @@ describe("preemptive-compaction", () => {
role: "assistant",
sessionID,
providerID: "anthropic",
modelID: "claude-sonnet-4-5",
modelID: "claude-sonnet-4-6",
finish: true,
tokens: { input: 180000, output: 0, reasoning: 0, cache: { read: 10000, write: 0 } },
},
@@ -241,7 +241,7 @@ describe("preemptive-compaction", () => {
role: "assistant",
sessionID,
providerID: "anthropic",
modelID: "claude-sonnet-4-5",
modelID: "claude-sonnet-4-6",
finish: true,
tokens: {
input: 170000,
@@ -282,7 +282,7 @@ describe("preemptive-compaction", () => {
role: "assistant",
sessionID,
providerID: "anthropic",
modelID: "claude-sonnet-4-5",
modelID: "claude-sonnet-4-6",
finish: true,
tokens: {
input: 300000,
@@ -321,7 +321,7 @@ describe("preemptive-compaction", () => {
role: "assistant",
sessionID,
providerID: "anthropic",
modelID: "claude-sonnet-4-5",
modelID: "claude-sonnet-4-6",
finish: true,
tokens: {
input: 300000,
+6 -6
View File
@@ -83,7 +83,7 @@ describe("createThinkModeHook integration", () => {
const hook = createThinkModeHook()
const input = createMockInput(
"github-copilot",
"claude-sonnet-4-5",
"claude-sonnet-4-6",
"think about this"
)
@@ -92,7 +92,7 @@ describe("createThinkModeHook integration", () => {
// then should upgrade to high variant
const message = input.message as MessageWithInjectedProps
expect(input.message.model?.modelID).toBe("claude-sonnet-4-5-high")
expect(input.message.model?.modelID).toBe("claude-sonnet-4-6-high")
expect(message.thinking).toBeDefined()
})
})
@@ -201,7 +201,7 @@ describe("createThinkModeHook integration", () => {
const hook = createThinkModeHook()
const input = createMockInput(
"anthropic",
"claude-sonnet-4-5",
"claude-sonnet-4-6",
"think about this"
)
@@ -210,7 +210,7 @@ describe("createThinkModeHook integration", () => {
// then should work as before
const message = input.message as MessageWithInjectedProps
expect(input.message.model?.modelID).toBe("claude-sonnet-4-5-high")
expect(input.message.model?.modelID).toBe("claude-sonnet-4-6-high")
expect(message.thinking).toBeDefined()
})
@@ -272,7 +272,7 @@ describe("createThinkModeHook integration", () => {
const hook = createThinkModeHook()
const input = createMockInput(
"amazon-bedrock",
"claude-sonnet-4-5",
"claude-sonnet-4-6",
"think"
)
@@ -281,7 +281,7 @@ describe("createThinkModeHook integration", () => {
// then should inject bedrock thinking config
const message = input.message as MessageWithInjectedProps
expect(input.message.model?.modelID).toBe("claude-sonnet-4-5-high")
expect(input.message.model?.modelID).toBe("claude-sonnet-4-6-high")
expect(message.reasoningConfig).toBeDefined()
})
})
+8 -8
View File
@@ -30,7 +30,7 @@ describe("think-mode switcher", () => {
it("should resolve github-copilot Claude Sonnet to anthropic config", () => {
// given a github-copilot provider with Claude Sonnet model
const config = getThinkingConfig("github-copilot", "claude-sonnet-4-5")
const config = getThinkingConfig("github-copilot", "claude-sonnet-4-6")
// then should return anthropic thinking config
expect(config).not.toBeNull()
@@ -295,7 +295,7 @@ describe("think-mode switcher", () => {
it("should still work for amazon-bedrock provider", () => {
// given amazon-bedrock provider with claude model
const config = getThinkingConfig("amazon-bedrock", "claude-sonnet-4-5")
const config = getThinkingConfig("amazon-bedrock", "claude-sonnet-4-6")
// then should return bedrock thinking config
expect(config).not.toBeNull()
@@ -364,10 +364,10 @@ describe("think-mode switcher", () => {
describe("getHighVariant with prefixes", () => {
it("should preserve vertex_ai/ prefix when getting high variant", () => {
// given a model ID with vertex_ai/ prefix
const variant = getHighVariant("vertex_ai/claude-sonnet-4-5")
const variant = getHighVariant("vertex_ai/claude-sonnet-4-6")
// then should return high variant with prefix preserved
expect(variant).toBe("vertex_ai/claude-sonnet-4-5-high")
expect(variant).toBe("vertex_ai/claude-sonnet-4-6-high")
})
it("should preserve openai/ prefix when getting high variant", () => {
@@ -389,7 +389,7 @@ describe("think-mode switcher", () => {
it("should handle multiple different prefixes", () => {
// given various custom prefixes
expect(getHighVariant("azure/gpt-5")).toBe("azure/gpt-5-high")
expect(getHighVariant("bedrock/claude-sonnet-4-5")).toBe("bedrock/claude-sonnet-4-5-high")
expect(getHighVariant("bedrock/claude-sonnet-4-6")).toBe("bedrock/claude-sonnet-4-6-high")
expect(getHighVariant("custom-llm/gemini-3-pro")).toBe("custom-llm/gemini-3-pro-high")
})
@@ -430,7 +430,7 @@ describe("think-mode switcher", () => {
describe("getThinkingConfig with prefixes", () => {
it("should return null for custom providers (not in THINKING_CONFIGS)", () => {
// given custom provider with prefixed Claude model
const config = getThinkingConfig("dia-llm", "vertex_ai/claude-sonnet-4-5")
const config = getThinkingConfig("dia-llm", "vertex_ai/claude-sonnet-4-6")
// then should return null (custom provider not in THINKING_CONFIGS)
expect(config).toBeNull()
@@ -459,13 +459,13 @@ describe("think-mode switcher", () => {
it("should handle LLM proxy with vertex_ai prefix correctly", () => {
// given a custom LLM proxy provider using vertex_ai/ prefix
const providerID = "dia-llm"
const modelID = "vertex_ai/claude-sonnet-4-5"
const modelID = "vertex_ai/claude-sonnet-4-6"
// when getting high variant
const highVariant = getHighVariant(modelID)
// then should preserve the prefix
expect(highVariant).toBe("vertex_ai/claude-sonnet-4-5-high")
expect(highVariant).toBe("vertex_ai/claude-sonnet-4-6-high")
// #and when checking if already high
expect(isAlreadyHighVariant(modelID)).toBe(false)
+3 -3
View File
@@ -21,8 +21,8 @@
* Custom providers may use prefixes for routing (e.g., vertex_ai/, openai/).
*
* @example
* extractModelPrefix("vertex_ai/claude-sonnet-4-5") // { prefix: "vertex_ai/", base: "claude-sonnet-4-5" }
* extractModelPrefix("claude-sonnet-4-5") // { prefix: "", base: "claude-sonnet-4-5" }
* extractModelPrefix("vertex_ai/claude-sonnet-4-6") // { prefix: "vertex_ai/", base: "claude-sonnet-4-6" }
* extractModelPrefix("claude-sonnet-4-6") // { prefix: "", base: "claude-sonnet-4-6" }
* extractModelPrefix("openai/gpt-5.2") // { prefix: "openai/", base: "gpt-5.2" }
*/
function extractModelPrefix(modelID: string): { prefix: string; base: string } {
@@ -87,7 +87,7 @@ function resolveProvider(providerID: string, modelID: string): string {
// For OpenAI models, this signals that reasoning_effort should be set to "high"
const HIGH_VARIANT_MAP: Record<string, string> = {
// Claude
"claude-sonnet-4-5": "claude-sonnet-4-5-high",
"claude-sonnet-4-6": "claude-sonnet-4-6-high",
"claude-opus-4-6": "claude-opus-4-6-high",
// Gemini
"gemini-3-pro": "gemini-3-pro-high",
@@ -1374,9 +1374,9 @@ describe("todo-continuation-enforcer", () => {
setMainSession(sessionID)
const mockMessagesWithCompaction = [
{ info: { id: "msg-1", role: "user", agent: "sisyphus", model: { providerID: "anthropic", modelID: "claude-sonnet-4-5" } } },
{ info: { id: "msg-2", role: "assistant", agent: "sisyphus", modelID: "claude-sonnet-4-5", providerID: "anthropic" } },
{ info: { id: "msg-3", role: "assistant", agent: "compaction", modelID: "claude-sonnet-4-5", providerID: "anthropic" } },
{ info: { id: "msg-1", role: "user", agent: "sisyphus", model: { providerID: "anthropic", modelID: "claude-sonnet-4-6" } } },
{ info: { id: "msg-2", role: "assistant", agent: "sisyphus", modelID: "claude-sonnet-4-6", providerID: "anthropic" } },
{ info: { id: "msg-3", role: "assistant", agent: "compaction", modelID: "claude-sonnet-4-6", providerID: "anthropic" } },
]
const mockInput = {