hotfix: Add Claude Haiku 4.5 support (#6889)
* Add Claude Haiku 4.5 support * Fix Claude Haiku 4.5 outputting "<function_calls>" * v3.32.8 Release Notes
This commit is contained in:
1 parent
9a7c6ed201
commit
66a4eb0f8e
17 files changed
+86
-10
No files matched your search
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## [3.32.8]
|
||||
|
||||
- Add Claude Haiku 4.5 support
|
||||
|
||||
## [3.32.7]
|
||||
|
||||
- Add JP and Global inference profile options to AWS Bedrock
|
||||
|
||||
@@ -16,6 +16,7 @@ description: "Learn how to configure and use Anthropic Claude models with Cline.
|
||||
|
||||
Cline supports the following Anthropic Claude models:
|
||||
|
||||
- `claude-haiku-4-5-20251001`
|
||||
- `claude-opus-4-1-20250805`
|
||||
- `claude-opus-4-20250514`
|
||||
- `anthropic/claude-sonnet-4.5` (Recommended)
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "claude-dev",
|
||||
"version": "3.32.7",
|
||||
"version": "3.32.8",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "claude-dev",
|
||||
"version": "3.32.7",
|
||||
"version": "3.32.8",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.37.0",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"name": "claude-dev",
|
||||
"displayName": "Cline",
|
||||
"description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.",
|
||||
"version": "3.32.7",
|
||||
"version": "3.32.8",
|
||||
"icon": "assets/icons/icon.png",
|
||||
"engines": {
|
||||
"vscode": "^1.84.0"
|
||||
|
||||
@@ -55,6 +55,7 @@ export class AnthropicHandler implements ApiHandler {
|
||||
|
||||
switch (modelId) {
|
||||
// 'latest' alias does not support cache_control
|
||||
case "claude-haiku-4-5-20251001":
|
||||
case "claude-sonnet-4-5-20250929":
|
||||
case "claude-sonnet-4-20250514":
|
||||
case "claude-3-7-sonnet-20250219":
|
||||
|
||||
@@ -757,6 +757,7 @@ export class AwsBedrockHandler implements ApiHandler {
|
||||
(baseModelId.includes("3-7") ||
|
||||
baseModelId.includes("sonnet-4") ||
|
||||
baseModelId.includes("opus-4") ||
|
||||
baseModelId.includes("haiku-4-5") ||
|
||||
baseModelId.includes("sonnet-4-5")) &&
|
||||
budgetTokens !== 0
|
||||
)
|
||||
|
||||
@@ -79,12 +79,16 @@ export class VertexHandler implements ApiHandler {
|
||||
// Claude implementation
|
||||
const budget_tokens = this.options.thinkingBudgetTokens || 0
|
||||
const reasoningOn = !!(
|
||||
(modelId.includes("3-7") || modelId.includes("sonnet-4") || modelId.includes("opus-4")) &&
|
||||
(modelId.includes("3-7") ||
|
||||
modelId.includes("sonnet-4") ||
|
||||
modelId.includes("opus-4") ||
|
||||
modelId.includes("haiku-4-5")) &&
|
||||
budget_tokens !== 0
|
||||
)
|
||||
let stream
|
||||
|
||||
switch (modelId) {
|
||||
case "claude-haiku-4-5@20251001":
|
||||
case "claude-sonnet-4@20250514":
|
||||
case "claude-opus-4-1@20250805":
|
||||
case "claude-opus-4@20250514":
|
||||
|
||||
@@ -34,6 +34,8 @@ export async function createOpenRouterStream(
|
||||
// this was initially specifically for claude models (some models may 'support prompt caching' automatically without this)
|
||||
// handles direct model.id match logic
|
||||
switch (model.id) {
|
||||
case "anthropic/claude-haiku-4.5":
|
||||
case "anthropic/claude-4.5-haiku":
|
||||
case "anthropic/claude-sonnet-4.5":
|
||||
case "anthropic/claude-4.5-sonnet": // OpenRouter accidentally included this in model list for a brief moment, and users may be using this model id. And to support prompt caching, we need to add it here.
|
||||
case "anthropic/claude-sonnet-4":
|
||||
@@ -95,6 +97,8 @@ export async function createOpenRouterStream(
|
||||
// (models usually default to max tokens allowed)
|
||||
let maxTokens: number | undefined
|
||||
switch (model.id) {
|
||||
case "anthropic/claude-haiku-4.5":
|
||||
case "anthropic/claude-4.5-haiku":
|
||||
case "anthropic/claude-sonnet-4.5":
|
||||
case "anthropic/claude-4.5-sonnet":
|
||||
case "anthropic/claude-sonnet-4":
|
||||
@@ -133,6 +137,8 @@ export async function createOpenRouterStream(
|
||||
|
||||
let reasoning: { max_tokens: number } | undefined
|
||||
switch (model.id) {
|
||||
case "anthropic/claude-haiku-4.5":
|
||||
case "anthropic/claude-4.5-haiku":
|
||||
case "anthropic/claude-sonnet-4.5":
|
||||
case "anthropic/claude-4.5-sonnet":
|
||||
case "anthropic/claude-sonnet-4":
|
||||
|
||||
@@ -146,6 +146,8 @@ export async function refreshOpenRouterModels(
|
||||
modelInfo.cacheWritesPrice = 3.75
|
||||
modelInfo.cacheReadsPrice = 0.3
|
||||
break
|
||||
case "anthropic/claude-haiku-4.5":
|
||||
case "anthropic/claude-4.5-haiku":
|
||||
case "anthropic/claude-3-5-haiku":
|
||||
case "anthropic/claude-3-5-haiku:beta":
|
||||
case "anthropic/claude-3-5-haiku-20241022":
|
||||
|
||||
@@ -1777,6 +1777,10 @@ export class Task {
|
||||
content = content.replace(/<thinking>\s?/g, "")
|
||||
content = content.replace(/\s?<\/thinking>/g, "")
|
||||
|
||||
// New claude models tend to output <function_calls> tags which we don't want to show in the chat
|
||||
content = content.replace(/<function_calls>\s?/g, "")
|
||||
content = content.replace(/\s?<\/function_calls>/g, "")
|
||||
|
||||
// Remove partial XML tag at the very end of the content (for tool use and thinking tags)
|
||||
// (prevents scrollview from jumping when tags are automatically removed)
|
||||
const lastOpenBracketIndex = content.lastIndexOf("<")
|
||||
|
||||
@@ -288,6 +288,16 @@ export const anthropicModels = {
|
||||
cacheReadsPrice: 0.3,
|
||||
tiers: CLAUDE_SONNET_1M_TIERS,
|
||||
},
|
||||
"claude-haiku-4-5-20251001": {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 200_000,
|
||||
supportsImages: true,
|
||||
supportsPromptCache: true,
|
||||
inputPrice: 1,
|
||||
outputPrice: 5.0,
|
||||
cacheWritesPrice: 1.25,
|
||||
cacheReadsPrice: 0.1,
|
||||
},
|
||||
"claude-sonnet-4-20250514": {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 200_000,
|
||||
@@ -397,6 +407,11 @@ export const claudeCodeModels = {
|
||||
supportsImages: false,
|
||||
supportsPromptCache: false,
|
||||
},
|
||||
"claude-haiku-4-5-20251001": {
|
||||
...anthropicModels["claude-haiku-4-5-20251001"],
|
||||
supportsImages: false,
|
||||
supportsPromptCache: false,
|
||||
},
|
||||
"claude-sonnet-4-5-20250929": {
|
||||
...anthropicModels["claude-sonnet-4-5-20250929"],
|
||||
supportsImages: false,
|
||||
@@ -457,6 +472,16 @@ export const bedrockModels = {
|
||||
cacheReadsPrice: 0.3,
|
||||
tiers: CLAUDE_SONNET_1M_TIERS,
|
||||
},
|
||||
"anthropic.claude-haiku-4-5-20251001-v1:0": {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 200_000,
|
||||
supportsImages: true,
|
||||
supportsPromptCache: true,
|
||||
inputPrice: 1,
|
||||
outputPrice: 5.0,
|
||||
cacheWritesPrice: 1.25,
|
||||
cacheReadsPrice: 0.1,
|
||||
},
|
||||
"anthropic.claude-sonnet-4-20250514-v1:0": {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 200_000,
|
||||
@@ -691,6 +716,16 @@ export const vertexModels = {
|
||||
cacheWritesPrice: 3.75,
|
||||
cacheReadsPrice: 0.3,
|
||||
},
|
||||
"claude-haiku-4-5@20251001": {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 200_000,
|
||||
supportsImages: false,
|
||||
supportsPromptCache: true,
|
||||
inputPrice: 1.0,
|
||||
outputPrice: 5.0,
|
||||
cacheWritesPrice: 1.25,
|
||||
cacheReadsPrice: 0.1,
|
||||
},
|
||||
"claude-opus-4-1@20250805": {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 200_000,
|
||||
|
||||
@@ -24,7 +24,13 @@ export function isAnthropicModelId(modelId: string): modelId is AnthropicModelId
|
||||
export function isClaude4ModelFamily(id: string): boolean {
|
||||
const modelId = normalize(id)
|
||||
return (
|
||||
modelId.includes("sonnet-4") || modelId.includes("opus-4") || modelId.includes("4-sonnet") || modelId.includes("4-opus")
|
||||
modelId.includes("sonnet-4") ||
|
||||
modelId.includes("opus-4") ||
|
||||
modelId.includes("4-sonnet") ||
|
||||
modelId.includes("4-opus") ||
|
||||
modelId.includes("haiku-4") ||
|
||||
modelId.includes("4-5-haiku") ||
|
||||
modelId.includes("4.5-haiku")
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { AccountServiceClient, StateServiceClient } from "@/services/grpc-client
|
||||
import { getAsVar, VSC_INACTIVE_SELECTION_BACKGROUND } from "@/utils/vscStyles"
|
||||
import { useApiConfigurationHandlers } from "../settings/utils/useApiConfigurationHandlers"
|
||||
|
||||
export const CURRENT_MODEL_BANNER_VERSION = 1
|
||||
export const CURRENT_MODEL_BANNER_VERSION = 2
|
||||
|
||||
export const NewModelBanner: React.FC = () => {
|
||||
const { clineUser } = useClineAuth()
|
||||
@@ -31,7 +31,7 @@ export const NewModelBanner: React.FC = () => {
|
||||
}, [])
|
||||
|
||||
const setNewModel = () => {
|
||||
const modelId = "anthropic/claude-sonnet-4.5"
|
||||
const modelId = "anthropic/claude-haiku-4.5"
|
||||
// set both plan and act modes to use new model
|
||||
handleFieldsChange({
|
||||
planModeOpenRouterModelId: modelId,
|
||||
@@ -76,10 +76,10 @@ export const NewModelBanner: React.FC = () => {
|
||||
}}>
|
||||
<h4 className="m-0 flex items-center gap-2" style={{ paddingRight: "18px" }}>
|
||||
<Megaphone className="w-4 h-4" />
|
||||
Claude Sonnet 4.5
|
||||
Claude Haiku 4.5
|
||||
</h4>
|
||||
<p className="m-0">
|
||||
Anthropic's latest model excels at complex planning and long-horizon coding tasks.{" "}
|
||||
Anthropic's fastest model with frontier-level coding intelligence at a fraction of the cost.{" "}
|
||||
<span className="text-link cursor-pointer">{user ? "Try new model" : "Try with Cline account"} →</span>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -49,6 +49,11 @@ const featuredModels = [
|
||||
{
|
||||
id: "anthropic/claude-sonnet-4.5",
|
||||
description: "Recommended for agentic coding in Cline",
|
||||
label: "Best",
|
||||
},
|
||||
{
|
||||
id: "anthropic/claude-haiku-4.5",
|
||||
description: "Fast frontier intelligence at low cost",
|
||||
label: "New",
|
||||
},
|
||||
{
|
||||
@@ -218,6 +223,8 @@ const OpenRouterModelPicker: React.FC<OpenRouterModelPickerProps> = ({ isPopup,
|
||||
const showBudgetSlider = useMemo(() => {
|
||||
return (
|
||||
Object.entries(openRouterModels)?.some(([id, m]) => id === selectedModelId && m.thinkingConfig) ||
|
||||
selectedModelId?.toLowerCase().includes("claude-haiku-4.5") ||
|
||||
selectedModelId?.toLowerCase().includes("claude-4.5-haiku") ||
|
||||
selectedModelId?.toLowerCase().includes("claude-sonnet-4.5") ||
|
||||
selectedModelId?.toLowerCase().includes("claude-sonnet-4") ||
|
||||
selectedModelId?.toLowerCase().includes("claude-opus-4.1") ||
|
||||
|
||||
@@ -19,6 +19,7 @@ export const SUPPORTED_ANTHROPIC_THINKING_MODELS = [
|
||||
"claude-opus-4-1-20250805",
|
||||
"claude-sonnet-4-5-20250929",
|
||||
`claude-sonnet-4-5-20250929${CLAUDE_SONNET_1M_SUFFIX}`,
|
||||
"claude-haiku-4-5-20251001",
|
||||
]
|
||||
|
||||
/**
|
||||
|
||||
@@ -455,6 +455,7 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
selectedModelId === `anthropic.claude-sonnet-4-5-20250929-v1:0${CLAUDE_SONNET_1M_SUFFIX}` ||
|
||||
selectedModelId === "anthropic.claude-opus-4-1-20250805-v1:0" ||
|
||||
selectedModelId === "anthropic.claude-opus-4-20250514-v1:0" ||
|
||||
selectedModelId === "anthropic.claude-haiku-4-5-20251001-v1:0" ||
|
||||
(modeFields.awsBedrockCustomSelected &&
|
||||
modeFields.awsBedrockCustomModelBaseId === "anthropic.claude-3-7-sonnet-20250219-v1:0") ||
|
||||
(modeFields.awsBedrockCustomSelected &&
|
||||
@@ -470,7 +471,9 @@ export const BedrockProvider = ({ showModelOptions, isPopup, currentMode }: Bedr
|
||||
(modeFields.awsBedrockCustomSelected &&
|
||||
modeFields.awsBedrockCustomModelBaseId === "anthropic.claude-opus-4-1-20250805-v1:0") ||
|
||||
(modeFields.awsBedrockCustomSelected &&
|
||||
modeFields.awsBedrockCustomModelBaseId === "anthropic.claude-opus-4-20250514-v1:0")) && (
|
||||
modeFields.awsBedrockCustomModelBaseId === "anthropic.claude-opus-4-20250514-v1:0") ||
|
||||
(modeFields.awsBedrockCustomSelected &&
|
||||
modeFields.awsBedrockCustomModelBaseId === "anthropic.claude-haiku-4-5-20251001-v1:0")) && (
|
||||
<ThinkingBudgetSlider currentMode={currentMode} />
|
||||
)}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ interface VertexProviderProps {
|
||||
|
||||
// Vertex models that support thinking
|
||||
const SUPPORTED_THINKING_MODELS = [
|
||||
"claude-haiku-4-5@20251001",
|
||||
"claude-3-7-sonnet@20250219",
|
||||
"claude-sonnet-4@20250514",
|
||||
"claude-opus-4@20250514",
|
||||
|
||||
Reference in new issue
Block a user