fix(gemini): emit signaturelessToolCallMode:text for GEMINI format models (#2801)

Integrated into release/v3.8.6
This commit is contained in:
Hernan Javier Ardila Sanchez
2026-05-27 22:05:36 +02:00
committed by GitHub
parent 87fad5d171
commit 0e9aed4d03

View File

@@ -523,7 +523,10 @@ export function openaiToGeminiRequest(
model: string,
body: Record<string, unknown>,
stream: boolean,
credentials: Record<string, unknown> | null = null
credentials: Record<string, unknown> | null = null,
options: {
signaturelessToolCallMode?: "native" | "text";
} = {}
) {
// Thread the signature namespace so a thinking model's thoughtSignature (cached on the
// response turn under `<connectionId>:<toolCallId>`) is found and re-attached to the
@@ -533,7 +536,10 @@ export function openaiToGeminiRequest(
credentials && typeof credentials._signatureNamespace === "string"
? credentials._signatureNamespace
: null;
return openaiToGeminiBase(model, body, stream, { signatureNamespace });
return openaiToGeminiBase(model, body, stream, {
signatureNamespace,
signaturelessToolCallMode: options.signaturelessToolCallMode,
});
}
// OpenAI -> Gemini CLI (Cloud Code Assist)
@@ -695,7 +701,15 @@ export function openaiToAntigravityRequest(model, body, stream, credentials = nu
}
// Register
register(FORMATS.OPENAI, FORMATS.GEMINI, openaiToGeminiRequest, null);
register(
FORMATS.OPENAI,
FORMATS.GEMINI,
(model, body, stream = false, credentials = null) =>
openaiToGeminiRequest(model, body, stream, credentials, {
signaturelessToolCallMode: "text",
}),
null
);
register(
FORMATS.OPENAI,
FORMATS.GEMINI_CLI,