diff --git a/src/providers/gemini.rs b/src/providers/gemini.rs index 611b3c75..5db27d8c 100644 --- a/src/providers/gemini.rs +++ b/src/providers/gemini.rs @@ -309,8 +309,10 @@ impl GeminiProvider { let args = serde_json::from_str::(&tc.function.arguments) .unwrap_or_else(|_| serde_json::json!({})); - // RESTORE: Use tc.id as thought_signature if it was originally one - let thought_signature = if tc.id.starts_with("sig_") || !tc.id.contains('-') { + // RESTORE: Use tc.id as thought_signature if it was originally one. + // We skip our own generated IDs (which start with 'call_') + // because they are not valid base64-encoded Gemini signatures. + let thought_signature = if !tc.id.starts_with("call_") { Some(tc.id.clone()) } else { None