fix(translator): route Gemini thinking through reasoning_effort on OpenAI-compatible wire
This commit is contained in:
@@ -105,12 +105,16 @@ export function extractThinking(body) {
|
||||
// at the call-site where intent is snapshotted before format translation.
|
||||
export const captureThinking = extractThinking;
|
||||
|
||||
// Resolve thinking format: provider override > capability > derive(targetFormat).
|
||||
const NATIVE_ONLY_FORMATS = new Set(["gemini-level", "gemini-budget", "claude-budget", "claude-adaptive", "kiro"]);
|
||||
|
||||
function resolveFormat(targetFormat, model, provider) {
|
||||
const providerFmt = provider ? PROVIDERS[provider]?.thinkingFormat : null;
|
||||
if (providerFmt) return providerFmt;
|
||||
const caps = getCapabilitiesForModel(provider, model);
|
||||
if (caps.thinkingFormat) return caps.thinkingFormat;
|
||||
const isOpenAIWire = targetFormat === "openai" || targetFormat === "openai-responses";
|
||||
if (caps.thinkingFormat && !(isOpenAIWire && NATIVE_ONLY_FORMATS.has(caps.thinkingFormat))) {
|
||||
return caps.thinkingFormat;
|
||||
}
|
||||
return FORMAT_TO_NATIVE[targetFormat] || "openai";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user