-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
Summary
When sending functionResponse back to Gemini after a tool call, the code uses the internal tracking ID (response.id) instead of the original function name. This violates the Gemini API contract and causes Gemini to return empty responses.
Evidence
From a user's diagnostic logs (gemini-2.5-flash-lite):
- 75 out of 76 tool responses resulted in empty assistant replies
- 100% of responses after
functionResponsewere empty - 100% of responses after
textmessages were non-empty
Example from logs:
functionCall.name = "developer__text_editor" ✓ Correct
functionResponse.name = "d9X7Azly" ✗ Wrong (random ID)
Root Cause
In crates/goose/src/providers/formats/google.rs (lines 130-131 and 148-149):
function_response.insert("name".to_string(), json!(response.id));The response.id is a random 8-character alphanumeric string generated internally for tracking, not the function name.
Expected Behavior
Per Google's Gemini API docs, functionResponse.name must match the functionCall.name that was originally sent.
Comparison with Other Providers
| Provider | Field | Value Used | Correct? |
|---|---|---|---|
| Anthropic | tool_use_id |
response.id |
✅ Yes (ID-based) |
| OpenAI | tool_call_id |
response.id |
✅ Yes (ID-based) |
| Google/Gemini | name |
response.id |
❌ Bug (should be function name) |
Proposed Fix
The functionResponse.name should use the original function name. This requires either:
- Storing the function name in
ToolResponsewhen created (from the correspondingToolRequest) - Looking up the function name from the matching
ToolRequestwhen formatting the response
User Impact
Users experience:
- "No response after tool use"
- Tools execute but Goose goes silent
- Files modified but no acknowledgment from the model
Notes
- This code has been present since V1.0 (
1c9a7c0b050)
Metadata
Metadata
Assignees
Labels
No labels