ERROR goose::agents::truncate: Error: Request failed: Request failed with status: 400 Bad Request
Describe the bug After interacting with Goose for few hours, I get the following error
ERROR goose::agents::truncate: Error: Request failed: Request failed with status: 400 Bad Request
It doesn't seem to be transient as once I get stuck I need to close my session. Up until the error everything works perfectly. Let me know if there are any logs I can grab
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior Not to get stuck in an error state
Please provide following information:
- OS & Arch: OSx
- Interface: CLI
- Version: 1.0.0
- Extensions enabled: Jetbrains
- Provider & Model: Sonnet 3.5 through litellm (open ai compat)
@digitalbuddha can you try the latest canary version? we also print out the payload when that error happens so it might be easier to debug.
curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | CANARY=true bash
since you mentioned its happening after few hours of usage, i wonder if you're hitting context limits but litellm is doing error handling differently and we're not raising ProviderError::ContextLengthExceeded appropriately so that means we don't attempt to truncate
https://github.com/block/goose/blob/654e5c6e633976a9158633f93f6e078c797c1a7d/crates/goose/src/providers/anthropic.rs#L89
Sure will try later today. I'm definitely hitting context limits earlier as my usage is in the tens of dollars during a session. Can I grab additional logs anywhere?
if you're using the CLI, then you should see logs in ~/.config/goose/logs/cli
for GUI: ~/.config/goose/logs/server/
Unsure if it is the same cause, but I am also running into this error when trying to run mcp-obsidian. Goose works fine until I enable this extension and then crashes immediately.
( O)> test
◒ Taming tensors... 2025-02-01T18:15:21.628479Z ERROR goose::agents::truncate: Error: Request failed: Request failed with status: 400 Bad Request. Message: * GenerateContentRequest.tools[0].function_declarations[2].parameters.properties[filepath].format: only 'enum' is supported for STRING type
* GenerateContentRequest.tools[0].function_declarations[4].parameters.properties[filepath].format: only 'enum' is supported for STRING type
* GenerateContentRequest.tools[0].function_declarations[5].parameters.properties[filepath].format: only 'enum' is supported for STRING type
* GenerateContentRequest.tools[0].function_declarations[6].parameters.properties[query].properties: should be non-empty for OBJECT type
at crates/goose/src/agents/truncate.rs:279
Ran into this error: Request failed: Request failed with status: 400 Bad Request. Message: * GenerateContentRequest.tools[0].function_declara
tions[2].parameters.properties[filepath].format: only 'enum' is supported for STRING type
* GenerateContentRequest.tools[0].function_declarations[4].parameters.properties[filepath].format: only 'enum' is supported for STRING type
* GenerateContentRequest.tools[0].function_declarations[5].parameters.properties[filepath].format: only 'enum' is supported for STRING type
* GenerateContentRequest.tools[0].function_declarations[6].parameters.properties[query].properties: should be non-empty for OBJECT type
.
Please retry if you think this is a transient or recoverable error.
dup of #933
Taking a look
I am also getting this error when using Gemini 2.0 flash and Jetbrains plugin
We are encountering an issue when using the Google Gemini API key. The error occurs whenever an empty input is entered in the command line or when Goose returns an empty result. To resolve this, we need to locate the corresponding file in the .config/goose/sessions directory, find the record with the empty line, and delete it.
We are encountering an issue when using the Google Gemini API key. The error occurs whenever an empty input is entered in the command line or when Goose returns an empty result. To resolve this, we need to locate the corresponding file in the .config/goose/sessions directory, find the record with the empty line, and delete it.
Just ran into this error with Gemini 2.5 / Google API.
( O)> lets commit and push changes
◓ Gathering digital breadcrumbs... 2025-04-08T14:55:38.962900Z ERROR goose::agents::truncate: Error: Request failed: Request failed with status: 400 Bad Request. Message: * GenerateContentRequest.contents[35].parts: contents.parts must not be empty.
at crates/goose/src/agents/truncate.rs:479
Ran into this error: Request failed: Request failed with status: 400 Bad Request. Message: * GenerateContentRequest.contents[35].parts: contents.parts must not be empty.
.
Please retry if you think this is a transient or recoverable error.
( O)> lets commit and push changes
◐ Recycling random thoughts... 2025-04-08T14:55:54.798942Z ERROR goose::agents::truncate: Error: Request failed: Request failed with status: 400 Bad Request. Message: * GenerateContentRequest.contents[35].parts: contents.parts must not be empty.
at crates/goose/src/agents/truncate.rs:479
Ran into this error: Request failed: Request failed with status: 400 Bad Request. Message: * GenerateContentRequest.contents[35].parts: contents.parts must not be empty.
.
Please retry if you think this is a transient or recoverable error.
It does not seem to be transient error.
goose --version 1.0.17
@VasilijP can you share your session log?