Merge pull request #2474 from code-yeongyu/fix/regression-check-cleanup

fix: tighten Anthropic provider matching and fix look-at test isolation
This commit is contained in:
YeonGyu-Kim
2026-03-12 00:37:25 +09:00
committed by GitHub
2 changed files with 8 additions and 3 deletions

View File

@@ -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 {

View File

@@ -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