diff --git a/src/shared/context-limit-resolver.ts b/src/shared/context-limit-resolver.ts index cb3c64e83..361fa45d0 100644 --- a/src/shared/context-limit-resolver.ts +++ b/src/shared/context-limit-resolver.ts @@ -8,7 +8,8 @@ export type ContextLimitModelCacheState = { } function isAnthropicProvider(providerID: string): boolean { - return providerID.toLowerCase().includes("anthropic") + const normalized = providerID.toLowerCase() + return normalized === "anthropic" || normalized === "google-vertex-anthropic" || normalized === "aws-bedrock-anthropic" } function getAnthropicActualLimit(modelCacheState?: ContextLimitModelCacheState): number { diff --git a/src/tools/look-at/tools.test.ts b/src/tools/look-at/tools.test.ts index 45a35f9a3..63713041b 100644 --- a/src/tools/look-at/tools.test.ts +++ b/src/tools/look-at/tools.test.ts @@ -1,9 +1,13 @@ -import { describe, expect, test, mock } from "bun:test" +import { afterEach, describe, expect, test, mock } from "bun:test" import type { ToolContext } from "@opencode-ai/plugin/tool" -import { setVisionCapableModelsCache } from "../../shared/vision-capable-models-cache" +import { clearVisionCapableModelsCache, setVisionCapableModelsCache } from "../../shared/vision-capable-models-cache" import { normalizeArgs, validateArgs, createLookAt } from "./tools" describe("look-at tool", () => { + afterEach(() => { + clearVisionCapableModelsCache() + }) + describe("normalizeArgs", () => { // given LLM might use `path` instead of `file_path` // when called with path parameter