MCPcopy
hub / github.com/codeaashu/claude-code / modelSupportsAutoMode

Function modelSupportsAutoMode

src/utils/betas.ts:160–195  ·  view source on GitHub ↗
(model: string)

Source from the content-addressed store, hash-verified

158
159// @[MODEL LAUNCH]: Add the new model if it supports auto mode (specifically PI probes) — ask in #proj-claude-code-safety-research.
160export function modelSupportsAutoMode(model: string): boolean {
161 if (feature('TRANSCRIPT_CLASSIFIER')) {
162 const m = getCanonicalName(model)
163 // External: firstParty-only at launch (PI probes not wired for
164 // Bedrock/Vertex/Foundry yet). Checked before allowModels so the GB
165 // override can't enable auto mode on unsupported providers.
166 if (process.env.USER_TYPE !== 'ant' && getAPIProvider() !== 'firstParty') {
167 return false
168 }
169 // GrowthBook override: tengu_auto_mode_config.allowModels force-enables
170 // auto mode for listed models, bypassing the denylist/allowlist below.
171 // Exact model IDs (e.g. "claude-strudel-v6-p") match only that model;
172 // canonical names (e.g. "claude-strudel") match the whole family.
173 const config = getFeatureValue_CACHED_MAY_BE_STALE<{
174 allowModels?: string[]
175 }>('tengu_auto_mode_config', {})
176 const rawLower = model.toLowerCase()
177 if (
178 config?.allowModels?.some(
179 am => am.toLowerCase() === rawLower || am.toLowerCase() === m,
180 )
181 ) {
182 return true
183 }
184 if (process.env.USER_TYPE === 'ant') {
185 // Denylist: block known-unsupported claude models, allow everything else (ant-internal models etc.)
186 if (m.includes('claude-3-')) return false
187 // claude-*-4 not followed by -[6-9]: blocks bare -4, -4-YYYYMMDD, -4@, -4-0 thru -4-5
188 if (/claude-(opus|sonnet|haiku)-4(?!-[6-9])/.test(m)) return false
189 return true
190 }
191 // External allowlist (firstParty already checked above).
192 return /^claude-(opus|sonnet)-4-6/.test(m)
193 }
194 return false
195}
196
197/**
198 * Get the correct tool search beta header for the current API provider.

Callers 4

verifyAutoModeGateAccessFunction · 0.85
isAutoModeGateEnabledFunction · 0.85
runHeadlessStreamingFunction · 0.85

Calls 4

featureFunction · 0.85
getCanonicalNameFunction · 0.85
getAPIProviderFunction · 0.85

Tested by

no test coverage detected