Fix: hardcode Claude max_tokens to 128k

Co-authored-by: gpt-5.3-codex <no-reply@openai.com>
This commit is contained in:
2026-03-31 00:13:03 -07:00
parent d871970662
commit 59ae2b2493

View File

@@ -142,6 +142,7 @@ export async function streamClaude({ apiKey, body, signal, onDelta, isRunning })
const client = new Anthropic({ apiKey })
const online = (body.model ?? '').endsWith(':online')
const model = online ? body.model.slice(0, -7) : body.model
const CLAUDE_MAX_TOKENS = 128000
const system = body.messages
.filter(m => m.role === 'system')
@@ -160,7 +161,7 @@ export async function streamClaude({ apiKey, body, signal, onDelta, isRunning })
return null
}).filter(Boolean),
})).filter(m => m.content.length),
max_tokens: body.max_tokens || 64000,
max_tokens: CLAUDE_MAX_TOKENS,
}
if (system) payload.system = system
if (Number.isFinite(+body.temperature)) payload.temperature = +body.temperature