fix: support Gemini 3's thought signatures (#5806)

Signed-off-by: Salvatore Testa <sal@withpersona.com>
This commit is contained in:
Salvatore Testa
2025-11-19 21:28:27 -08:00
committed by GitHub
parent 5f3a31dcbf
commit cfdf01567d
9 changed files with 64 additions and 6 deletions
+14
View File
@@ -512,6 +512,7 @@ mod tests {
let tool_request = ToolRequest {
id: "test-id".to_string(),
tool_call: Ok(tool_call),
thought_signature: None,
};
let result = tool_request_to_markdown(&tool_request, true);
@@ -535,6 +536,7 @@ mod tests {
let tool_request = ToolRequest {
id: "test-id".to_string(),
tool_call: Ok(tool_call),
thought_signature: None,
};
let result = tool_request_to_markdown(&tool_request, true);
@@ -662,6 +664,7 @@ mod tests {
let tool_request = ToolRequest {
id: "shell-cat".to_string(),
tool_call: Ok(tool_call),
thought_signature: None,
};
let python_code = r#"#!/usr/bin/env python3
@@ -708,6 +711,7 @@ if __name__ == "__main__":
let tool_request = ToolRequest {
id: "git-status".to_string(),
tool_call: Ok(git_status_call),
thought_signature: None,
};
let git_output = " M src/main.rs\n?? temp.txt\n A new_feature.rs";
@@ -746,6 +750,7 @@ if __name__ == "__main__":
let _tool_request = ToolRequest {
id: "cargo-build".to_string(),
tool_call: Ok(cargo_build_call),
thought_signature: None,
};
let build_output = r#" Compiling goose-cli v0.1.0 (/Users/user/goose)
@@ -790,6 +795,7 @@ warning: unused variable `x`
let _tool_request = ToolRequest {
id: "curl-api".to_string(),
tool_call: Ok(curl_call),
thought_signature: None,
};
let api_response = r#"{
@@ -838,6 +844,7 @@ warning: unused variable `x`
let tool_request = ToolRequest {
id: "editor-write".to_string(),
tool_call: Ok(editor_call),
thought_signature: None,
};
let text_content = TextContent {
@@ -878,6 +885,7 @@ warning: unused variable `x`
let _tool_request = ToolRequest {
id: "editor-view".to_string(),
tool_call: Ok(editor_call),
thought_signature: None,
};
let python_code = r#"import os
@@ -927,6 +935,7 @@ def process_data(data: List[Dict]) -> List[Dict]:
let _tool_request = ToolRequest {
id: "shell-error".to_string(),
tool_call: Ok(error_call),
thought_signature: None,
};
let error_output = r#"python: can't open file 'nonexistent_script.py': [Errno 2] No such file or directory
@@ -962,6 +971,7 @@ Command failed with exit code 2"#;
let tool_request = ToolRequest {
id: "script-exec".to_string(),
tool_call: Ok(script_call),
thought_signature: None,
};
let script_output = r#"Python 3.11.5 (main, Aug 24 2023, 15:18:16) [Clang 14.0.3 ]
@@ -1008,6 +1018,7 @@ Command failed with exit code 2"#;
let _tool_request = ToolRequest {
id: "multi-cmd".to_string(),
tool_call: Ok(multi_call),
thought_signature: None,
};
let multi_output = r#"total 24
@@ -1052,6 +1063,7 @@ drwx------ 3 user staff 96 Dec 6 16:20 com.apple.launchd.abc
let tool_request = ToolRequest {
id: "grep-search".to_string(),
tool_call: Ok(grep_call),
thought_signature: None,
};
let grep_output = r#"src/main.rs:15:async fn process_request(req: Request) -> Result<Response> {
@@ -1095,6 +1107,7 @@ src/middleware.rs:12:async fn auth_middleware(req: Request, next: Next) -> Resul
let _tool_request = ToolRequest {
id: "json-test".to_string(),
tool_call: Ok(tool_call),
thought_signature: None,
};
let json_output = r#"{"status": "success", "data": {"count": 42}}"#;
@@ -1129,6 +1142,7 @@ src/middleware.rs:12:async fn auth_middleware(req: Request, next: Next) -> Resul
let tool_request = ToolRequest {
id: "npm-install".to_string(),
tool_call: Ok(npm_call),
thought_signature: None,
};
let npm_output = r#"added 57 packages, and audited 58 packages in 3s