Ashwin/codex/pr2 retry consistency#377
Ashwin/codex/pr2 retry consistency#377AshwinRenjith wants to merge 3 commits intogoogleworkspace:mainfrom
Conversation
🦋 Changeset detectedLatest commit: c843c76 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the robustness and consistency of HTTP request handling within the application by centralizing and refining retry logic. It addresses a critical reliability gap by ensuring that all discovery-driven command executions benefit from resilient retry behavior, particularly against rate limiting, while simultaneously preventing unsafe retries for non-idempotent operations and safeguarding against excessive server-mandated delays. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively hardens the retry logic for API requests, making the CLI more resilient to throttling (HTTP 429 errors). The core changes, which route generic executor requests through a shared retry handler and add safety gates for non-idempotent methods like POST, are well-implemented and improve consistency. The addition of a cap on the Retry-After duration is a good defensive measure.
I've identified a couple of areas for improvement to enhance maintainability: one is a simplification of the retry logic in src/client.rs, and the other is to address duplicated test helper code between src/client.rs and src/executor.rs. These are detailed in the review comments.
Overall, this is a solid improvement to the tool's reliability.
|
/gemini review |
Harden retry behavior consistency for discovery-driven command execution by routing the generic executor path through shared retry handling and tightening backoff safety.
This fixes a reliability gap where core executor requests were sent once while some helper flows retried on 429.
Description
This PR fixes inconsistent retry behavior in the primary HTTP execution path.
What changed
send_builder_with_retry) so discovery-driven commands are resilient to HTTP 429 throttling.GET,HEAD,OPTIONS,PUT,DELETE).POSTare sent once (no replay on 429).Retry-Afterto prevent unbounded server-controlled sleep durations.Retry-After.+triagelist call to use shared retry helper.POSTon 429.Dry Run Output:
{ "note": "N/A — this PR does not add a new feature/command or change Discovery request body shape; it only hardens retry behavior." }Why this is safe
Retry-Aftervalues.Checklist:
AGENTS.mdguidelines (no generatedgoogle-*crates).cargo fmt --allto format the code perfectly.cargo clippy -- -D warningsand resolved all warnings.pnpx changeset) to document my changes.