goose icon indicating copy to clipboard operation
goose copied to clipboard

ERROR goose::agents::truncate: Error: Request failed: Request failed with status: 400 Bad Request

Open digitalbuddha opened this issue 10 months ago • 8 comments

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:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. 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 avatar Jan 30 '25 17:01 digitalbuddha

@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

salman1993 avatar Jan 30 '25 17:01 salman1993

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?

digitalbuddha avatar Jan 30 '25 17:01 digitalbuddha

if you're using the CLI, then you should see logs in ~/.config/goose/logs/cli for GUI: ~/.config/goose/logs/server/

salman1993 avatar Jan 30 '25 18:01 salman1993

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.

armstrys avatar Feb 01 '25 18:02 armstrys

dup of #933

angiejones avatar Feb 05 '25 03:02 angiejones

Taking a look

wendytang avatar Feb 07 '25 19:02 wendytang

I am also getting this error when using Gemini 2.0 flash and Jetbrains plugin

rubixhacker avatar Feb 21 '25 16:02 rubixhacker

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.

liuhh666233 avatar Feb 24 '25 05:02 liuhh666233

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 avatar Apr 08 '25 15:04 VasilijP

@VasilijP can you share your session log?

yingjiehe-xyz avatar Apr 11 '25 17:04 yingjiehe-xyz