Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions open-sse/translator/request/openai-to-gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
);
Comment thread
herjarsa marked this conversation as resolved.
Comment on lines +704 to +712

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the repository style guide, changing production code in open-sse/ requires including tests. Please add or update the corresponding unit/translator tests to verify that signaturelessToolCallMode: "text" is correctly applied and handled for the GEMINI format.

References
  1. Rule 9: Always include tests when changing production code (src/, open-sse/, electron/, bin/). (link)

register(
FORMATS.OPENAI,
FORMATS.GEMINI_CLI,
Expand Down