-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: Parse and use retryDelay from Google API RateLimitExceeded errors #4124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ac6ded9 to
44634fa
Compare
jamadeo
left a comment
There was a problem hiding this 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))?; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
crates/goose/src/providers/retry.rs
Outdated
| ); | ||
|
|
||
| let delay = config.delay_for_attempt(attempts); | ||
| let delay = if let ProviderError::RateLimitExceeded { retry_delay, .. } = &error { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, done.
|
@sings-to-bees-on-wednesdays this is good to go, just needs lint + format issues addressed. To format, use |
9f557cd to
6cce190
Compare
Signed-off-by: sings-to-bees-on-wednesdays <[email protected]>
Signed-off-by: sings-to-bees-on-wednesdays <[email protected]>
6cce190 to
be67a92
Compare
|
Thanks, fixed and rebased. |
Signed-off-by: sings-to-bees-on-wednesdays <[email protected]>
Signed-off-by: sings-to-bees-on-wednesdays <[email protected]>
be67a92 to
dc741c0
Compare
|
sorry about the delay, can you resolve the conflicts? |
…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) ...
…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]>
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.