goose: ERROR goose::agents::truncate: Error: Execution error: No usage data in response

After a couple of iterations with goose I’m starting constantly getting the error:

ERROR goose::agents::truncate: Error: Execution error: No usage data in response
  at crates/goose/src/agents/truncate.rs:256

Ran into this error: Execution error: No usage data in response.

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

Provider: Claude-3-5 through OpenRouter Version: 1.0.0

Exiting / Restoring the session does not help, only creating a new session can fix it for me.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (3 by maintainers)

Most upvoted comments

This has become literally infuriating and is now near constant.

Invalid parameters: Could not interpret tool use parameters for id toolu_01MMatWj8Th7Vryic57vTCu7: EOF while parsing an object at line 1 column 1188

◒  Untangling spaghetti code...                                                                        
2025-02-06T01:00:12.780061Z  WARN goose::providers::openrouter: Failed to get usage data: No usage data in response
    at crates/goose/src/providers/openrouter.rs:211

( O)> continue
◐  Weaving wisdom web...                                                                               
2025-02-06T01:00:35.298073Z  WARN goose::providers::openrouter: Failed to get usage data: No usage data in response
    at crates/goose/src/providers/openrouter.rs:211

This is on a NEW SESSION with a very small amount of text in the request, not an existing large session.

I’m obviously using OpenRouter. Using Anthropic or any other system causes nearly immediate failures due to token use, because, even on Tier 4, goose uses so many tokens so fast that the system starts giving me API limitations after just a few queries.

Example:

ERROR goose::agents::truncate: Error: Rate limit exceeded: Some(Object {"error": Object {"message": String("This request would exceed your organization’s rate limit of 160,000 input tokens per minute. For details, refer to: https://docs.anthropic.com/en/api/rate-limits; see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://www.anthropic.com/contact-sales to discuss your options for a rate limit increase."), "type": String("rate_limit_error")}, "type": String("error")})
    at crates/goose/src/agents/truncate.rs:279

This is after two queries.

@HunterR0se thanks for the feedback! That’s actually expected behavior for the warning to be admitted but it shouldn’t interfere with your session conversation. If it’s distracting/annoying though we could remove it and only emit a debug trace that gets written to the log.

Thanks for the logs! Seems like a possibly transient issue with OpenRouter as they suggest in their docs that every response should have a usage field, but evidently seems like that isn’t always the case! Added a fix here to just emit a warning trace if this happens instead of erroring and failing to return the response: https://github.com/block/goose/pull/907