mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-23 08:45:50 +00:00
fix: 移除 auto mode 的 provider 和模型白名单限制
移除 firstParty provider 限制和 claude-(opus|sonnet)-4-[67] 模型白名单, 使所有模型和 provider 在 TRANSCRIPT_CLASSIFIER feature 启用时均可使用 auto mode。 Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
This commit is contained in:
@@ -157,42 +157,8 @@ export function modelSupportsStructuredOutputs(model: string): boolean {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @[MODEL LAUNCH]: Add the new model if it supports auto mode (specifically PI probes) — ask in #proj-claude-code-safety-research.
|
export function modelSupportsAutoMode(_model: string): boolean {
|
||||||
export function modelSupportsAutoMode(model: string): boolean {
|
return feature('TRANSCRIPT_CLASSIFIER')
|
||||||
if (feature('TRANSCRIPT_CLASSIFIER')) {
|
|
||||||
const m = getCanonicalName(model)
|
|
||||||
// External: firstParty-only at launch (PI probes not wired for
|
|
||||||
// Bedrock/Vertex/Foundry yet). Checked before allowModels so the GB
|
|
||||||
// override can't enable auto mode on unsupported providers.
|
|
||||||
if (process.env.USER_TYPE !== 'ant' && getAPIProvider() !== 'firstParty') {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// GrowthBook override: tengu_auto_mode_config.allowModels force-enables
|
|
||||||
// auto mode for listed models, bypassing the denylist/allowlist below.
|
|
||||||
// Exact model IDs (e.g. "claude-strudel-v6-p") match only that model;
|
|
||||||
// canonical names (e.g. "claude-strudel") match the whole family.
|
|
||||||
const config = getFeatureValue_CACHED_MAY_BE_STALE<{
|
|
||||||
allowModels?: string[]
|
|
||||||
}>('tengu_auto_mode_config', {})
|
|
||||||
const rawLower = model.toLowerCase()
|
|
||||||
if (
|
|
||||||
config?.allowModels?.some(
|
|
||||||
am => am.toLowerCase() === rawLower || am.toLowerCase() === m,
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if (process.env.USER_TYPE === 'ant') {
|
|
||||||
// Denylist: block known-unsupported claude models, allow everything else (ant-internal models etc.)
|
|
||||||
if (m.includes('claude-3-')) return false
|
|
||||||
// claude-*-4 not followed by -[6-9]: blocks bare -4, -4-YYYYMMDD, -4@, -4-0 thru -4-5
|
|
||||||
if (/claude-(opus|sonnet|haiku)-4(?!-[6-9])/.test(m)) return false
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
// External allowlist (firstParty already checked above).
|
|
||||||
return /^claude-(opus|sonnet)-4-[67]/.test(m)
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user