Skip to content

Conversation

@understood-the-assignment
Copy link
Contributor

When we exceed the TPM rate limit with the Google API, it helpfully includes a duration for how long to wait before we can safely try again. Let's grab that and use it instead of our existing back-off logic when it's present.

Copy link
Collaborator

@jamadeo jamadeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

.await?;

// Parse response
let message = response_to_message(unescape_json_values(&response))?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this now unused? feel free to delete it from utils.rs if so

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this was an accidental change, removed.

);

let delay = config.delay_for_attempt(attempts);
let delay = if let ProviderError::RateLimitExceeded { retry_delay, .. } = &error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can simplify to

    let delay = match &error {
        ProviderError::RateLimitExceeded {
            retry_delay: Some(provider_delay),
            ..
        } => *provider_delay,
        _ => config.delay_for_attempt(attempts),
    };

losing the debug but that doesn't seem terribly important to keep

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, done.

@jamadeo
Copy link
Collaborator

jamadeo commented Aug 19, 2025

@sings-to-bees-on-wednesdays this is good to go, just needs lint + format issues addressed. To format, use cargo fmt, and to lint you can run scripts/clippy-lint.sh

@understood-the-assignment understood-the-assignment force-pushed the gemini-limit branch 3 times, most recently from 9f557cd to 6cce190 Compare August 21, 2025 12:43
@understood-the-assignment
Copy link
Contributor Author

Thanks, fixed and rebased.

Signed-off-by: sings-to-bees-on-wednesdays <[email protected]>
Signed-off-by: sings-to-bees-on-wednesdays <[email protected]>
@DOsinga
Copy link
Collaborator

DOsinga commented Sep 24, 2025

sorry about the delay, can you resolve the conflicts?

@jamadeo jamadeo merged commit b5c133c into block:main Sep 25, 2025
10 checks passed
katzdave added a commit that referenced this pull request Sep 25, 2025
…ovements

* 'main' of github.com:block/goose: (23 commits)
  blog post on subagents vs subrecipes (#4829)
  fix chat button alignment and spacing for attachments (#4794)
  fix: remove nested double quotes in windows automation_script tool description (#4824)
  fix: a few things with the mcp snapshot test (#4818)
  Revert "fix(compaction): try to catch more context limit exceeded erors and compact" (#4820)
  test: add test coverage for Tools Inspector (#4700)
  feat: Parse and use retryDelay from Google API RateLimitExceeded errors (#4124)
  cleanup: remove unused link preview and goose response form components (#4795)
  fix build: latest bedrock version (#4812)
  prefer users SHELL (#4702)
  feat: update aws-sdk-bedrockruntime to enable AWS_BEARER_TOKEN_BEDROCK auth (#4327)
  correct the tests from an odd merge (#4804)
  docs: import yaml recipe (#4799)
  docs: Add openmetadata extension to goose mcp docs (#4547)
  Add elapsed time to the CLI output. (#4609)
  fix: Fix cell coordinate ordering in XlsxTool and add unit tests (#4551)
  Use gemini flash for summarization on open router (#4290)
  chore(deps): bump xcb from 1.5.0 to 1.6.0 (#4289)
  feat(shell): throw errors on interactive commands (#4788)
  feat: AgentManager - foundation for unified execution (#4389) (#4684)
  ...
HikaruEgashira pushed a commit to HikaruEgashira/goose that referenced this pull request Oct 3, 2025
…rs (block#4124)

Signed-off-by: sings-to-bees-on-wednesdays <[email protected]>
Co-authored-by: Jack Amadeo <[email protected]>
Co-authored-by: Jack Amadeo <[email protected]>
Signed-off-by: HikaruEgashira <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants