goose icon indicating copy to clipboard operation
goose copied to clipboard

`text content blocks must contain non-whitespace text` error

Open kalvinnchau opened this issue 9 months ago • 1 comments

Describe the bug

Sometimes the following error can occur:

Ran into this error: Request failed: Request failed with status: 400 Bad Request. Message: {"external_model_provider":"amazon-bedrock","external_model_error":{"message":"messages: text content blocks must contain non-whitespace text"}}.

Image

Currently unsure of how or when goose can get into that state.

To Reproduce We can manually reproduce this behavior by directly editing the session file:

  1. goose s --name whitespace
  2. say "hi"
  3. Open ~/.local/share/goose/sessions/whitespace.jsonl with your favorite editor
  4. Find the line with {"role":"user","created":1741285622,"content":[{"type":"text","text":"hi"}]} and replace "text":"hi" with "text":" ".
  5. goose s --name whitespace -r
  6. say "hi"
  7. See the error:
 Formatting future frames...                                                                                                                                                                                                                2025-03-06T18:27:33.310829Z ERROR goose::agents::truncate: Error: Request failed: Request failed with status: 400 Bad Request. Message: {"external_model_provider":"amazon-bedrock","external_model_error":{"message":"messages: text content blocks must contain non-whitespace text"}}
    at crates/goose/src/agents/truncate.rs:391

Ran into this error: Request failed: Request failed with status: 400 Bad Request. Message: {"external_model_provider":"amazon-bedrock","external_model_error":{"message":"messages: text content blocks must contain non-whitespace text"}}.

Please retry if you think this is a transient or recoverable error.

Screenshots If applicable, add screenshots to help explain your problem.

Please provide following information:

  • OS & Arch: [MacOS]
  • Interface: [UI & CLI]
  • Version: [1.0.8+] - based on user reports
  • Extensions enabled: [any]
  • Provider & Model: [any]

Additional context Add any other context about the problem here.

kalvinnchau avatar Mar 06 '25 18:03 kalvinnchau

Currently unable to replicate in a working session, paused until we can get some session logs to try to determine what sent the only whitespace text blocks.

kalvinnchau avatar Mar 11 '25 16:03 kalvinnchau

going to close this due to not being able to reproduce

DOsinga avatar Aug 04 '25 12:08 DOsinga