The open source coding agent.
TypeScript
zen: handle 1m context
Franke5b355e4583f
diff --git a/packages/console/app/src/routes/zen/util/provider/anthropic.ts b/packages/console/app/src/routes/zen/util/provider/anthropic.tsindex a5f92a29acf..7081e980d92 100644--- a/packages/console/app/src/routes/zen/util/provider/anthropic.ts+++ b/packages/console/app/src/routes/zen/util/provider/anthropic.ts@@ -20,7 +20,7 @@ export const anthropicHelper: ProviderHelper = ({ reqModel, providerModel }) =>const isBedrockModelArn = providerModel.startsWith("arn:aws:bedrock:")const isBedrockModelID = providerModel.startsWith("global.anthropic.")const isBedrock = isBedrockModelArn || isBedrockModelID- const isSonnet = reqModel.includes("sonnet")+ const supports1m = reqModel.includes("sonnet") || reqModel.includes("opus-4-6")return {format: "anthropic",modifyUrl: (providerApi: string, isStream?: boolean) =>@@ -33,7 +33,7 @@ export const anthropicHelper: ProviderHelper = ({ reqModel, providerModel }) =>} else {headers.set("x-api-key", apiKey)headers.set("anthropic-version", headers.get("anthropic-version") ?? "2023-06-01")- if (body.model.startsWith("claude-sonnet-")) {+ if (supports1m) {headers.set("anthropic-beta", "context-1m-2025-08-07")}}@@ -43,7 +43,7 @@ export const anthropicHelper: ProviderHelper = ({ reqModel, providerModel }) =>...(isBedrock? {anthropic_version: "bedrock-2023-05-31",- anthropic_beta: isSonnet ? "context-1m-2025-08-07" : undefined,+ anthropic_beta: supports1m ? "context-1m-2025-08-07" : undefined,model: undefined,stream: undefined,}