Skip to content

Set default max attempts to 3 and use the common variable#18209

Merged
sehoon38 merged 1 commit into
mainfrom
sehoon/max_retries
Feb 3, 2026
Merged

Set default max attempts to 3 and use the common variable#18209
sehoon38 merged 1 commit into
mainfrom
sehoon/max_retries

Conversation

@sehoon38

@sehoon38 sehoon38 commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Set default max attempts to 3

Details

There's inconsistency on the max attempts defined, and using a common variable to make sure it uses the same max attempts variable.

Related Issues

Fixes #18208

How to Validate

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @sehoon38, 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 aims to enhance the consistency and maintainability of retry logic within the codebase. It centralizes the definition of the default maximum retry attempts into a single, shared constant, ensuring that all retry mechanisms adhere to a uniform policy. This change resolves an existing inconsistency and simplifies future modifications to the retry strategy.

Highlights

  • Standardized Max Attempts: The default maximum number of retry attempts has been standardized to 3 across the application.
  • Introduced Common Variable: A new constant, "DEFAULT_MAX_ATTEMPTS", was introduced in retry.ts to centralize this value.
  • Consistency in GeminiChat: The GeminiChat class now uses DEFAULT_MAX_ATTEMPTS for availability retries, replacing a previously hardcoded value of 10.
Changelog
  • packages/core/src/core/geminiChat.ts
    • Imported the new DEFAULT_MAX_ATTEMPTS constant from ../utils/retry.js.
    • Replaced the hardcoded 10 for maxAttempts in the onRetry callback with DEFAULT_MAX_ATTEMPTS.
  • packages/core/src/utils/retry.ts
    • Defined and exported DEFAULT_MAX_ATTEMPTS with a value of 3.
    • Updated the DEFAULT_RETRY_OPTIONS to use DEFAULT_MAX_ATTEMPTS for its maxAttempts property.
Activity
  • The pull request was initiated by sehoon38 to address issue Retries showing upto 10, but stops at 3 #18208.
  • The author provided a detailed summary, specific changes, validation steps, and a pre-merge checklist.
  • No further review comments or activity are available in the provided context.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@sehoon38 sehoon38 marked this pull request as ready for review February 3, 2026 17:35
@sehoon38 sehoon38 requested a review from a team as a code owner February 3, 2026 17:35
@gemini-cli gemini-cli Bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Feb 3, 2026
@sehoon38 sehoon38 enabled auto-merge February 3, 2026 17:37
@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

Size Change: +142 B (0%)

Total Size: 23.7 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 23.7 MB +142 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B

compressed-size-action

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request successfully resolves an inconsistency in the default maximum retry attempts. By introducing a shared DEFAULT_MAX_ATTEMPTS constant and applying it in both the retry logic and event reporting, the PR fixes a bug where the logged maxAttempts could be misleading. The changes improve code maintainability and consistency. The implementation is correct and I have no further suggestions.

@sehoon38 sehoon38 added this pull request to the merge queue Feb 3, 2026
Merged via the queue into main with commit e1bd1d2 Feb 3, 2026
28 checks passed
@sehoon38 sehoon38 deleted the sehoon/max_retries branch February 3, 2026 17:59
@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: preview
  • Commit: e1bd1d239facd486fd894ee49a8f8b522c97d833
  • Workflows Created: 1

🔗 Track Progress:

@skeshive

skeshive commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

/patch preview

@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: preview
  • Commit: e1bd1d239facd486fd894ee49a8f8b522c97d833
  • Workflows Created: 1

🔗 Track Progress:

@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

🚀 Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. Review and approve the hotfix PR: #18226
  2. Once merged, the patch release will automatically trigger
  3. You'll receive updates here when the release completes

🔗 Track Progress:

@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

🚀 Patch Release Started!

📋 Release Details:

  • Environment: prod
  • Channel: preview → publishing to npm tag preview
  • Version: v0.27.0-preview.6
  • Hotfix PR: Merged ✅
  • Release Branch: release/v0.27.0-preview.6-pr-18209

⏳ Status: The patch release is now running. You'll receive another update when it completes.

🔗 Track Progress:

@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

Patch Release Complete!

📦 Release Details:

🎉 Status: Your patch has been successfully released and published to npm!

📝 What's Available:

🔗 Links:

yuvrajangadsingh pushed a commit to yuvrajangadsingh/gemini-cli that referenced this pull request Feb 4, 2026
sidwan02 pushed a commit to sidwan02/gemini-cli-gemma that referenced this pull request Feb 6, 2026
kuishou68 pushed a commit to iOfficeAI/gemini-cli-pro that referenced this pull request Feb 27, 2026
@sripasg sripasg added the size/s A small PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality size/s A small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retries showing upto 10, but stops at 3

5 participants