feat: 解除 max/xhigh effort 级别的模型白名单限制

This commit is contained in:
claude-code-best
2026-05-22 20:09:10 +08:00
parent 66c892521b
commit 7b52054ff5
2 changed files with 66 additions and 37 deletions

View File

@@ -67,51 +67,22 @@ export function modelSupportsEffort(model: string): boolean {
return getAPIProvider() === 'firstParty'
}
// @[MODEL LAUNCH]: Add the new model to the allowlist if it supports 'max' effort.
// Per API docs, 'max' is Opus 4.6/4.7 only for public models — other models return an error.
// However, DeepSeek V4 Pro also supports max effort when using Anthropic-compatible API.
export function modelSupportsMaxEffort(model: string): boolean {
const supported3P = get3PModelCapabilityOverride(model, 'max_effort')
// Effort max/xhigh restrictions removed — all models that support effort
// can now use these levels. API errors are the user's responsibility.
export function modelSupportsMaxEffort(_model: string): boolean {
const supported3P = get3PModelCapabilityOverride(_model, 'max_effort')
if (supported3P !== undefined) {
return supported3P
}
// Support DeepSeek V4 Pro specifically (Anthropic-compatible API)
if (model.toLowerCase().includes('deepseek-v4-pro')) {
return true
}
if (
model.toLowerCase().includes('opus-4-7') ||
model.toLowerCase().includes('opus-4-6')
) {
return true
}
if (process.env.USER_TYPE === 'ant' && resolveAntModel(model)) {
return true
}
return false
return true
}
// @[MODEL LAUNCH]: Add the new model to the allowlist if it supports 'xhigh' effort.
// 'xhigh' was introduced with Opus 4.7 as a level between 'high' and 'max'.
export function modelSupportsXhighEffort(model: string): boolean {
const supported3P = get3PModelCapabilityOverride(model, 'xhigh_effort')
export function modelSupportsXhighEffort(_model: string): boolean {
const supported3P = get3PModelCapabilityOverride(_model, 'xhigh_effort')
if (supported3P !== undefined) {
return supported3P
}
if (
getAPIProvider() === 'openai' &&
isChatGPTAuthMode() &&
isChatGPTCodexReasoningModel(model)
) {
return true
}
if (model.toLowerCase().includes('opus-4-7')) {
return true
}
if (process.env.USER_TYPE === 'ant' && resolveAntModel(model)) {
return true
}
return false
return true
}
export function isEffortLevel(value: string): value is EffortLevel {