fix: avoid legacy Windows PasswordVault reads by default (#941)

* fix: avoid legacy Windows PasswordVault reads by default

* fix: isolate model capability override cache

---------

Co-authored-by: OpenClaude Worker 3 <worker-3@openclaude.local>
This commit is contained in:
Vasanth T
2026-04-28 21:00:48 +05:30
committed by GitHub
parent 8106880855
commit d321c8fc6a
4 changed files with 98 additions and 20 deletions

View File

@@ -23,6 +23,23 @@ const TIERS = [
},
] as const
function buildCapabilityOverrideCacheKey(
model: string,
capability: ModelCapabilityOverride,
): string {
const envParts = TIERS.flatMap(tier => [
process.env[tier.modelEnvVar] ?? '',
process.env[tier.capabilitiesEnvVar] ?? '',
])
return [
model.toLowerCase(),
capability,
getAPIProvider(),
...envParts,
].join('\0')
}
/**
* Check whether a 3p model capability override is set for a model that matches one of
* the pinned ANTHROPIC_DEFAULT_*_MODEL env vars.
@@ -46,5 +63,5 @@ export const get3PModelCapabilityOverride = memoize(
}
return undefined
},
(model, capability) => `${model.toLowerCase()}:${capability}`,
buildCapabilityOverrideCacheKey,
)