Skip to content

fix(cli): correct settings.json filename in max session turns message#27511

Open
crimsondhaks wants to merge 1 commit into
google-gemini:mainfrom
crimsondhaks:fix/max-turns-message-typo
Open

fix(cli): correct settings.json filename in max session turns message#27511
crimsondhaks wants to merge 1 commit into
google-gemini:mainfrom
crimsondhaks:fix/max-turns-message-typo

Conversation

@crimsondhaks
Copy link
Copy Markdown

Summary

The interactive max-session-turns warning displayed in useGeminiStream
referenced a non-existent setting.json file (singular). The actual file
is settings.json. Users searching for the file based on the message
would be unable to find it, exactly as reported in #25889.

Details

The fix is a single string change in packages/cli/src/ui/hooks/useGeminiStream.ts:

- `Please update this limit in your setting.json file.`
+ `Increase the limit by specifying maxSessionTurns in your settings.json file.`

Two improvements in one line:

  1. setting.jsonsettings.json (the actual bug from Maximum number of turns and their setting.json file that doesn't exist #25889).

  2. The new wording names the actual setting key (maxSessionTurns) and
    matches the wording already used by the non-interactive CLI for the
    same condition in packages/cli/src/utils/errors.ts:211:

    "Reached max session turns for this session. Increase the number
    of turns by specifying maxSessionTurns in settings.json."

    So interactive and non-interactive modes now give users the same
    actionable guidance.

No tests asserted the previous string, so no test updates were needed.

Related Issues

Fixes #25889

How to Validate

# Reproduce the original bug:
# 1. Set "model.maxSessionTurns": 1 in ~/.gemini/settings.json
# 2. Start an interactive session and exchange enough turns to hit the limit
# 3. Before fix: warning says "setting.json" (file doesn't exist)
#    After fix:  warning says "settings.json" and names maxSessionTurns

# Run the consumer test suite to confirm no regression:
npm run build --workspace @google/gemini-cli-core
npx vitest run --root packages/cli src/ui/hooks/useGeminiStream.test.tsx
# 80 tests pass

# Lint, typecheck, format:
npx eslint --max-warnings 0 packages/cli/src/ui/hooks/useGeminiStream.ts
npx prettier --check packages/cli/src/ui/hooks/useGeminiStream.ts

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed) — N/A, internal user-facing string only
  • Added/updated tests (if needed) — no existing test asserted this string; the change is a one-line UX wording fix mirrored from existing tested wording in errors.ts
  • Noted breaking changes (if any) — none, only a user-facing message wording change
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

The interactive max-session-turns warning displayed in `useGeminiStream`
referenced a non-existent `setting.json` file (singular). The actual
file is `settings.json`. Users searching for the file based on the
message would be unable to find it.

Also rephrase the message to name the actual setting key
(`maxSessionTurns`) and use the same wording already used by the
non-interactive CLI in `errors.ts:211` ("Reached max session turns for
this session. Increase the number of turns by specifying maxSessionTurns
in settings.json."), so users get consistent, actionable guidance in
both interactive and non-interactive modes.

Fixes google-gemini#25889
@crimsondhaks crimsondhaks requested a review from a team as a code owner May 28, 2026 05:10
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 addresses a user-reported issue where the interactive CLI provided an incorrect filename in its max-session-turns warning. By updating the message, the change ensures users are directed to the correct configuration file and provided with clear instructions on how to adjust their session limits, matching the guidance provided in other parts of the application.

Highlights

  • Corrected Filename: Updated the interactive max-session-turns warning to reference the correct 'settings.json' filename instead of the incorrect 'setting.json'.
  • Improved Guidance: Enhanced the error message to explicitly mention the 'maxSessionTurns' configuration key, providing better actionable instructions for users.
  • Consistency: Aligned the interactive CLI warning message with the existing non-interactive CLI error messaging for a unified user experience.
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 the 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 counterproductive. 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.

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.

Copy link
Copy Markdown
Contributor

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

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 updates the warning message displayed when a session reaches its maximum number of turns. It corrects a typo in the configuration file name from 'setting.json' to 'settings.json' and explicitly guides the user to use the 'maxSessionTurns' property to increase the limit. There are no review comments to address, and the changes look correct.

@gemini-cli gemini-cli Bot added priority/p2 Important but can be addressed in a future release. area/core Issues related to User Interface, OS Support, Core Functionality labels May 28, 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 priority/p2 Important but can be addressed in a future release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maximum number of turns and their setting.json file that doesn't exist

1 participant