mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Set Claude Sonnet 4.5 as default for key providers (#8922)
This commit is contained in:
parent
200a7c8aa9
commit
ea339738e5
9 changed files with 35 additions and 11 deletions
|
|
@ -3,7 +3,7 @@ import type { ModelInfo } from "../model.js"
|
|||
// https://docs.anthropic.com/en/docs/about-claude/models
|
||||
|
||||
export type AnthropicModelId = keyof typeof anthropicModels
|
||||
export const anthropicDefaultModelId: AnthropicModelId = "claude-sonnet-4-20250514"
|
||||
export const anthropicDefaultModelId: AnthropicModelId = "claude-sonnet-4-5"
|
||||
|
||||
export const anthropicModels = {
|
||||
"claude-sonnet-4-5": {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import type { ModelInfo } from "../model.js"
|
|||
|
||||
export type BedrockModelId = keyof typeof bedrockModels
|
||||
|
||||
export const bedrockDefaultModelId: BedrockModelId = "anthropic.claude-sonnet-4-20250514-v1:0"
|
||||
export const bedrockDefaultModelId: BedrockModelId = "anthropic.claude-sonnet-4-5-20250929-v1:0"
|
||||
|
||||
export const bedrockDefaultPromptRouterModelId: BedrockModelId = "anthropic.claude-3-sonnet-20240229-v1:0"
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export function convertModelNameForVertex(modelName: string): string {
|
|||
|
||||
// Claude Code
|
||||
export type ClaudeCodeModelId = keyof typeof claudeCodeModels
|
||||
export const claudeCodeDefaultModelId: ClaudeCodeModelId = "claude-sonnet-4-20250514"
|
||||
export const claudeCodeDefaultModelId: ClaudeCodeModelId = "claude-sonnet-4-5"
|
||||
export const CLAUDE_CODE_DEFAULT_MAX_OUTPUT_TOKENS = 16000
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ModelInfo } from "../model.js"
|
||||
|
||||
// https://openrouter.ai/models?order=newest&supported_parameters=tools
|
||||
export const openRouterDefaultModelId = "anthropic/claude-sonnet-4"
|
||||
export const openRouterDefaultModelId = "anthropic/claude-sonnet-4.5"
|
||||
|
||||
export const openRouterDefaultModelInfo: ModelInfo = {
|
||||
maxTokens: 8192,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { ModelInfo } from "../model.js"
|
||||
|
||||
export const unboundDefaultModelId = "anthropic/claude-3-7-sonnet-20250219"
|
||||
export const unboundDefaultModelId = "anthropic/claude-sonnet-4-5"
|
||||
|
||||
export const unboundDefaultModelInfo: ModelInfo = {
|
||||
maxTokens: 8192,
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ describe("ClaudeCodeHandler", () => {
|
|||
const handlerWithInvalidModel = new ClaudeCodeHandler(options)
|
||||
const model = handlerWithInvalidModel.getModel()
|
||||
|
||||
expect(model.id).toBe("claude-sonnet-4-20250514") // default model
|
||||
expect(model.id).toBe("claude-sonnet-4-5") // default model
|
||||
})
|
||||
|
||||
test("should override maxTokens when claudeCodeMaxOutputTokens is provided", () => {
|
||||
|
|
@ -69,7 +69,7 @@ describe("ClaudeCodeHandler", () => {
|
|||
const handlerWithMaxTokens = new ClaudeCodeHandler(options)
|
||||
const model = handlerWithMaxTokens.getModel()
|
||||
|
||||
expect(model.id).toBe("claude-sonnet-4-20250514") // default model
|
||||
expect(model.id).toBe("claude-sonnet-4-5") // default model
|
||||
expect(model.info.maxTokens).toBe(16384) // Should use the configured value
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,18 @@ vitest.mock("../fetchers/modelCache", () => ({
|
|||
description: "Claude 3.7 Sonnet",
|
||||
thinking: false,
|
||||
},
|
||||
"anthropic/claude-sonnet-4.5": {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 200000,
|
||||
supportsImages: true,
|
||||
supportsPromptCache: true,
|
||||
inputPrice: 3,
|
||||
outputPrice: 15,
|
||||
cacheWritesPrice: 3.75,
|
||||
cacheReadsPrice: 0.3,
|
||||
description: "Claude 4.5 Sonnet",
|
||||
thinking: false,
|
||||
},
|
||||
"anthropic/claude-3.7-sonnet:thinking": {
|
||||
maxTokens: 128000,
|
||||
contextWindow: 200000,
|
||||
|
|
@ -83,7 +95,7 @@ describe("OpenRouterHandler", () => {
|
|||
it("returns default model info when options are not provided", async () => {
|
||||
const handler = new OpenRouterHandler({})
|
||||
const result = await handler.fetchModel()
|
||||
expect(result.id).toBe("anthropic/claude-sonnet-4")
|
||||
expect(result.id).toBe("anthropic/claude-sonnet-4.5")
|
||||
expect(result.info.supportsPromptCache).toBe(true)
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,18 @@ vitest.mock("../fetchers/modelCache", () => ({
|
|||
description: "Claude 3.5 Sonnet",
|
||||
thinking: false,
|
||||
},
|
||||
"anthropic/claude-sonnet-4-5": {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 200000,
|
||||
supportsImages: true,
|
||||
supportsPromptCache: true,
|
||||
inputPrice: 3,
|
||||
outputPrice: 15,
|
||||
cacheWritesPrice: 3.75,
|
||||
cacheReadsPrice: 0.3,
|
||||
description: "Claude 4.5 Sonnet",
|
||||
thinking: false,
|
||||
},
|
||||
"anthropic/claude-3-7-sonnet-20250219": {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 200000,
|
||||
|
|
@ -312,7 +324,7 @@ describe("UnboundHandler", () => {
|
|||
it("should return default model when invalid model provided", async () => {
|
||||
const handlerWithInvalidModel = new UnboundHandler({ ...mockOptions, unboundModelId: "invalid/model" })
|
||||
const modelInfo = await handlerWithInvalidModel.fetchModel()
|
||||
expect(modelInfo.id).toBe("anthropic/claude-3-7-sonnet-20250219")
|
||||
expect(modelInfo.id).toBe("anthropic/claude-sonnet-4-5")
|
||||
expect(modelInfo.info).toBeDefined()
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ describe("useSelectedModel", () => {
|
|||
const { result } = renderHook(() => useSelectedModel(), { wrapper })
|
||||
|
||||
expect(result.current.provider).toBe("anthropic")
|
||||
expect(result.current.id).toBe("claude-sonnet-4-20250514")
|
||||
expect(result.current.id).toBe("claude-sonnet-4-5")
|
||||
expect(result.current.info).toBeUndefined()
|
||||
})
|
||||
})
|
||||
|
|
@ -442,7 +442,7 @@ describe("useSelectedModel", () => {
|
|||
const { result } = renderHook(() => useSelectedModel(apiConfiguration), { wrapper })
|
||||
|
||||
expect(result.current.provider).toBe("claude-code")
|
||||
expect(result.current.id).toBe("claude-sonnet-4-20250514") // Default model
|
||||
expect(result.current.id).toBe("claude-sonnet-4-5") // Default model
|
||||
expect(result.current.info).toBeDefined()
|
||||
expect(result.current.info?.supportsImages).toBe(false)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue