Skip to content

Using Gemini as a backend now results in a HTTP 400 Error when using tools #247

@stsquad

Description

@stsquad

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

Describe the bug

When attempting to use tools we get a 400 response from Gemini:

LLM response status: 400 body: [{                                                                                                                            
  "error": {                                                                                                                                                 
    "code": 400,                                                                                                                                             
    "message": "Please ensure that function call turn comes immediately after a user turn or after a function response turn.",                               
    "status": "INVALID_ARGUMENT"                                                                                                                             
  }                                                                                                                                                          
}                                                                                                                                                            
] 

To Reproduce
Steps to reproduce the behavior:

  1. Start `eca' in a project
  2. C-c RET - select google/gemini-3-flash-preview
  3. Run query which triggers tool use, e.g. /init
  4. Witness 400 error

Doctor
Running /doctor did confuse the model but it did spit out the following after some thought.

LLM response status: 400 body: [{                                                                                                                            
  "error": {                                                                                                                                                 
    "code": 400,                                                                                                                                             
    "message": "Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing                
thought_signature may lead to degraded model performance. Additional data, function call default_api:eca__read_file , position 6. Please refer to            
https://ai.google.dev/gemini-api/docs/thought-signatures for more details.",                                                                                 
    "status": "INVALID_ARGUMENT"                                                                                                                             
  }                                                                                                                                                          
}                                                                                                                                                            
]                                                                                                                                                            

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions