mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: Remove fallback thoughtSignature to prevent 400 errors with Gemini 3 models
This commit is contained in:
parent
1e71015e54
commit
be8ac86165
2 changed files with 5 additions and 5 deletions
|
|
@ -107,7 +107,7 @@ describe("convertAnthropicMessageToGemini", () => {
|
|||
expect(() => convertAnthropicMessageToGemini(anthropicMessage)).toThrow("Unsupported image source type")
|
||||
})
|
||||
|
||||
it("should convert a message with tool use", () => {
|
||||
it("should convert a message with tool use without thoughtSignature when none exists", () => {
|
||||
const anthropicMessage: Anthropic.Messages.MessageParam = {
|
||||
role: "assistant",
|
||||
content: [
|
||||
|
|
@ -133,7 +133,6 @@ describe("convertAnthropicMessageToGemini", () => {
|
|||
name: "calculator",
|
||||
args: { operation: "add", numbers: [2, 3] },
|
||||
},
|
||||
thoughtSignature: "skip_thought_signature_validator",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -42,10 +42,11 @@ export function convertAnthropicContentToGemini(
|
|||
// Determine the signature to attach to function calls.
|
||||
// If we're in a mode that expects signatures (includeThoughtSignatures is true):
|
||||
// 1. Use the actual signature if we found one in the history/content.
|
||||
// 2. Fallback to "skip_thought_signature_validator" if missing (e.g. cross-model history).
|
||||
// 2. Don't use a fallback - only include thoughtSignature if we have a real one.
|
||||
// The fallback "skip_thought_signature_validator" causes 400 errors with Gemini 3 models.
|
||||
let functionCallSignature: string | undefined
|
||||
if (includeThoughtSignatures) {
|
||||
functionCallSignature = activeThoughtSignature || "skip_thought_signature_validator"
|
||||
if (includeThoughtSignatures && activeThoughtSignature) {
|
||||
functionCallSignature = activeThoughtSignature
|
||||
}
|
||||
|
||||
if (typeof content === "string") {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue