Skip to content

fix(patch): cherry-pick 9a74271 to release/v0.33.0-preview.5-pr-21236 [CONFLICTS]#21714

Merged
gsquared94 merged 2 commits intorelease/v0.33.0-preview.5-pr-21236from
hotfix/v0.33.0-preview.5/0.33.0-preview.6/preview/cherry-pick-9a74271/pr-21236
Mar 9, 2026
Merged

fix(patch): cherry-pick 9a74271 to release/v0.33.0-preview.5-pr-21236 [CONFLICTS]#21714
gsquared94 merged 2 commits intorelease/v0.33.0-preview.5-pr-21236from
hotfix/v0.33.0-preview.5/0.33.0-preview.6/preview/cherry-pick-9a74271/pr-21236

Conversation

@gemini-cli-robot
Copy link
Collaborator

This PR automatically cherry-picks commit 9a74271 to patch version v0.33.0-preview.5 in the preview release to create version 0.33.0-preview.6.

⚠️ Merge Conflicts Detected

This cherry-pick resulted in merge conflicts that need manual resolution.

🔧 Next Steps:

  1. Review the conflicts: Check out this branch and review the conflict markers
  2. Resolve conflicts: Edit the affected files to resolve the conflicts
  3. Test the changes: Ensure the patch works correctly after resolution
  4. Update this PR: Push your conflict resolution

📋 Files with conflicts:

The commit has been created with conflict markers for easier manual resolution.

🚨 Important:

  • Do not merge this PR until conflicts are resolved
  • The automated patch release will trigger once this PR is merged

…#21236)

# Conflicts:
#	packages/core/src/code_assist/server.ts
@gemini-code-assist
Copy link
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 is an automated cherry-pick designed to integrate crucial updates to the billing overage strategy lifecycle and its interaction with application settings. The changes aim to improve the consistency and clarity of how billing states are managed across user turns, particularly concerning credit usage and model eligibility. It also streamlines the notification process for when AI credits are utilized. The PR currently requires manual intervention due to merge conflicts, which need to be resolved before it can be merged.

Highlights

  • Billing Overage Strategy Refinement: The handling of billing overage strategies has been refactored, introducing a dedicated "resetBillingTurnState" method to manage billing-related state per user turn and ensuring consistent application of configured strategies.
  • Model Eligibility for Overage: The "gemini-3-flash-preview" model has been added to the list of models eligible for overage billing, while "gemini-3.1-pro-preview-customtools" remains ineligible, with corresponding test updates.
  • Centralized Credit Usage Notification: The notification for 'Using AI Credits for this request' has been centralized to emit a "coreEvents" feedback message from the "CodeAssistServer", removing redundant history logging from the "creditsFlowHandler".
  • Configuration Enhancements: The CLI configuration now explicitly loads billing settings, and the core "Config" class includes new properties and methods ("creditsNotificationShown", "setCreditsNotificationShown", "getCreditsNotificationShown") to track and manage credit notification visibility.
Changelog
  • packages/cli/src/config/config.ts
    • Added 'billing' property to the loadCliConfig function's return object, ensuring billing settings are included in the CLI configuration.
  • packages/cli/src/ui/hooks/creditsFlowHandler.ts
    • Removed historyManager from the arguments of handleOverageMenu.
    • Removed the explicit addition of an 'Using AI Credits for this request' info message to the history manager within handleOverageMenu.
  • packages/cli/src/ui/hooks/useGeminiStream.test.tsx
    • Added resetBillingTurnState to the mocked configuration object for testing purposes.
  • packages/cli/src/ui/hooks/useGeminiStream.ts
    • Introduced a call to config.resetBillingTurnState when a new non-continuation stream starts, passing the merged billing overage strategy.
    • Added settings.merged.billing?.overageStrategy to the dependency array of the useGeminiStream hook.
  • packages/cli/src/ui/hooks/useQuotaAndFallback.ts
    • Removed the initialOverageStrategy variable and its associated logic.
    • Simplified the determination of overageStrategy to directly use the value from config.getBillingSettings().overageStrategy.
  • packages/core/src/billing/billing.test.ts
    • Updated the test case for isOverageEligibleModel to correctly assert that gemini-3-flash-preview returns true.
    • Confirmed that gemini-3.1-pro-preview-customtools returns false for overage eligibility.
  • packages/core/src/billing/billing.ts
    • Imported PREVIEW_GEMINI_FLASH_MODEL.
    • Added PREVIEW_GEMINI_FLASH_MODEL to the OVERAGE_ELIGIBLE_MODELS set.
  • packages/core/src/code_assist/server.ts
    • Introduced merge conflict markers related to telemetry imports.
    • Added logic to emit an 'info' feedback event via coreEvents when AI Credits are used for a request, and set creditsNotificationShown to true.
  • packages/core/src/config/config.test.ts
    • Added new test cases for billing state management and resetBillingTurnState functionality.
    • Added tests to verify that resetTurn does not reset billing state.
    • Added tests for resetBillingTurnState to confirm it resets overageStrategy to the configured value or defaults to 'ask', and resets creditsNotificationShown.
  • packages/core/src/config/config.ts
    • Added a private creditsNotificationShown boolean property to the Config class.
    • Implemented resetBillingTurnState method to reset creditsNotificationShown and set billing.overageStrategy.
    • Added setCreditsNotificationShown and getCreditsNotificationShown methods to manage the creditsNotificationShown property.
Activity
  • This pull request was automatically generated to cherry-pick commit 9a7427197bd2d8df9bf4cf5f723b4932557c5e0e to the release/v0.33.0-preview.5-pr-21236 branch.
  • Merge conflicts were detected during the cherry-pick process, requiring manual resolution.
  • The author, gemini-cli-robot, has provided instructions for reviewing and resolving the conflicts, testing the changes, and updating the PR.
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.

Copy link
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 appears to be a cherry-pick to apply a patch, but it contains unresolved merge conflicts. The changes themselves, related to billing and overage strategy, seem logical and well-structured. However, a critical issue is the presence of merge conflict markers in packages/core/src/code_assist/server.ts, which will prevent the code from compiling. This must be resolved before the pull request can be merged.

@gsquared94 gsquared94 enabled auto-merge (squash) March 9, 2026 15:58
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Size Change: +640 B (0%)

Total Size: 25.9 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 25.4 MB +640 B (0%)
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 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-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B

compressed-size-action

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Mar 9, 2026
@gsquared94 gsquared94 merged commit 8df4210 into release/v0.33.0-preview.5-pr-21236 Mar 9, 2026
25 checks passed
@gsquared94 gsquared94 deleted the hotfix/v0.33.0-preview.5/0.33.0-preview.6/preview/cherry-pick-9a74271/pr-21236 branch March 9, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants