Skip to content

Goose CLI call ends with Server error: Failed to call Bedrock: ValidationException(ValidationException { message: Some("The model returned the following errors: prompt is too long: 227255 tokens > 200000 maximum") #7442

@u35tpus

Description

@u35tpus

When Goose makes a Bedrock API call during a long agentic session, the accumulated conversation context exceeds the model's token limit, resulting in a hard failure with no graceful recovery. The error is not transient — it
will persist on every retry because the context window is already over the limit.

Error received:
Server error: Failed to call Bedrock: ValidationException:
"The model returned the following errors: prompt is too long: 227255 tokens > 200000 maximum"


To Reproduce
Steps to reproduce the behavior:

  1. Run a long agentic session via Goose (CLI or ACP) against AWS Bedrock
  2. Accumulate enough tool calls / outputs in the conversation history to exceed ~200k tokens
  3. Goose attempts the next LLM call
  4. Session fails with ValidationException: prompt is too long

Expected behavior
Goose should allow configuration for maximum number of tokens to be sent to LLM.


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


Please provide the following information

  • OS & Arch: Linux (container/k3s)
  • Interface: CLI / ACP
  • Version: (please fill in your Goose version)
  • Extensions enabled: (please fill in)
  • Provider & Model: AWS Bedrock – Claude Sonnet 4.5 (us.anthropic.claude-sonnet-4-5-20250514-v1:0)

Additional context
Additional context

  • Token count at failure: 227,255 tokens (limit: 200,000)
  • AWS Request ID: 095d61aa-b9f0-4b1f-b29e-2ee1cad537bb
  • The session was a multi-step coding + verification loop where tool call outputs (file reads, command outputs) accumulated over many turns
  • The retry message in the Goose error output says "Please retry if you think this is a transient or recoverable error" — this is incorrect for this error class; the issue is structural (context too large), not transient

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions