fix: resolve three open bugs (#2836, #2858, #2873)

- fix(context-limit): check modelContextLimitsCache for all Anthropic
  models, not just GA-model set; user config/cache wins over 200K default
  (fixes #2836)

- fix(agent-key-remapper): preserve config key aliases alongside display
  names so `opencode run --agent sisyphus` resolves correctly
  (fixes #2858)

- fix(tool-config): respect host permission.skill=deny by disabling
  skill/skill_mcp tools when host denies them (fixes #2873)

- test: update context-limit and agent-key-remapper tests to match new
  behavior
This commit is contained in:
YeonGyu-Kim
2026-03-27 13:32:18 +09:00
parent a081ddcefb
commit 40a92138ea
5 changed files with 20 additions and 24 deletions
+1 -12
View File
@@ -1,13 +1,6 @@
import process from "node:process"
const DEFAULT_ANTHROPIC_ACTUAL_LIMIT = 200_000
const ANTHROPIC_NO_HEADER_GA_MODEL_IDS = new Set([
"claude-opus-4-6",
"claude-opus-4.6",
"claude-sonnet-4-6",
"claude-sonnet-4.6",
])
export type ContextLimitModelCacheState = {
anthropicContext1MEnabled: boolean
modelContextLimitsCache?: Map<string, number>
@@ -26,10 +19,6 @@ function getAnthropicActualLimit(modelCacheState?: ContextLimitModelCacheState):
: DEFAULT_ANTHROPIC_ACTUAL_LIMIT
}
function isAnthropicNoHeaderGaModel(modelID: string): boolean {
return ANTHROPIC_NO_HEADER_GA_MODEL_IDS.has(modelID.toLowerCase())
}
export function resolveActualContextLimit(
providerID: string,
modelID: string,
@@ -40,7 +29,7 @@ export function resolveActualContextLimit(
if (explicit1M === 1_000_000) return explicit1M
const cachedLimit = modelCacheState?.modelContextLimitsCache?.get(`${providerID}/${modelID}`)
if (cachedLimit && isAnthropicNoHeaderGaModel(modelID)) return cachedLimit
if (cachedLimit) return cachedLimit
return DEFAULT_ANTHROPIC_ACTUAL_LIMIT
}