Skip to content

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

Merged
galz10 merged 2 commits intorelease/v0.33.0-preview.8-pr-21236from
hotfix/v0.33.0-preview.8/0.33.0-preview.9/preview/cherry-pick-9a74271/pr-21236
Mar 10, 2026
Merged

fix(patch): cherry-pick 9a74271 to release/v0.33.0-preview.8-pr-21236 [CONFLICTS]#21788
galz10 merged 2 commits intorelease/v0.33.0-preview.8-pr-21236from
hotfix/v0.33.0-preview.8/0.33.0-preview.9/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.8 in the preview release to create version 0.33.0-preview.9.

⚠️ 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 aimed at integrating critical fixes related to the billing overage strategy and AI credit management into a preview release. The changes focus on refining how billing settings are applied and reset per user interaction, improving the user experience around credit notifications, and updating model eligibility for overage. Due to merge conflicts, manual resolution is required to complete the integration of these important billing lifecycle adjustments.

Highlights

  • Billing Overage Strategy Refinement: Introduced a dedicated mechanism to reset billing-related state (like overage strategy and credit notification status) at the start of each user prompt turn, ensuring consistent behavior.
  • Credit Notification Management: Implemented a new creditsNotificationShown flag within the configuration to track and prevent redundant 'Using AI Credits' notifications, improving user experience.
  • Model Eligibility for Overage: Updated the list of models eligible for overage billing, specifically including gemini-3-flash-preview and clarifying the status of gemini-3.1-pro-preview-customtools.
  • Conflict Resolution and Integration: Resolved merge conflicts arising from the cherry-pick, integrating new telemetry logging and event emission for billing feedback within the code assist server.
  • Simplified Overage Flow: Streamlined the creditsFlowHandler by removing the direct dependency on historyManager for credit usage messages, centralizing notification logic.
Changelog
  • packages/cli/src/config/config.ts
    • Added 'billing' property to the configuration loaded by loadCliConfig.
  • packages/cli/src/ui/hooks/creditsFlowHandler.ts
    • Removed historyManager from handleOverageMenu arguments.
    • Removed the historyManager.addItem call that logged credit usage info.
  • packages/cli/src/ui/hooks/useGeminiStream.test.tsx
    • Added resetBillingTurnState to the mocked config object.
  • packages/cli/src/ui/hooks/useGeminiStream.ts
    • Added a call to config.resetBillingTurnState at the start of a new stream, passing the overageStrategy.
    • Included settings.merged.billing?.overageStrategy in the dependency array for a useCallback hook.
  • packages/cli/src/ui/hooks/useQuotaAndFallback.ts
    • Removed the initialOverageStrategy variable and its related logic.
    • Simplified the determination of overageStrategy to directly use the value from config.getBillingSettings().
  • packages/core/src/billing/billing.test.ts
    • Updated the test for isOverageEligibleModel to return false for gemini-3.1-pro-preview-customtools.
    • Updated the test for isOverageEligibleModel to return true for gemini-3-flash-preview.
  • 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
    • Resolved merge conflicts by adding imports for logInvalidChunk and coreEvents.
    • Implemented logic to set creditsNotificationShown and emit an info feedback event when AI credits are used for the first time in a turn.
  • packages/core/src/config/config.test.ts
    • Added a test to confirm resetTurn does not reset billing state.
    • Added tests for resetBillingTurnState to verify it resets overageStrategy to the configured value or a default, and resets creditsNotificationShown.
  • packages/core/src/config/config.ts
    • Added a private creditsNotificationShown boolean property.
    • Implemented resetBillingTurnState method to reset creditsNotificationShown and billing.overageStrategy.
    • Added setCreditsNotificationShown and getCreditsNotificationShown methods.
Activity
  • This pull request was automatically generated to cherry-pick commit 9a7427197bd2d8df9bf4cf5f723b4932557c5e0e to the release/v0.33.0-preview.8-pr-21236 branch.
  • The cherry-pick operation resulted in merge conflicts that require manual resolution.
  • The author (gemini-cli-robot) has provided clear instructions for resolving the conflicts, including reviewing conflict markers, editing affected files, testing changes, and updating the PR.
  • It is explicitly stated that the PR should not be merged until conflicts are resolved, and that an automated patch release will trigger upon successful merge.
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 cherry-picks a fix for the billing overage strategy lifecycle and enables overage for the gemini-3-flash-preview model, refactoring billing notifications and introducing new state management in the Config class. However, a critical issue was identified: an unresolved merge conflict in packages/core/src/code_assist/server.ts will break the build and must be resolved before merging.

Comment on lines +50 to +55
<<<<<<< HEAD
import { logBillingEvent } from '../telemetry/loggers.js';
=======
import { logBillingEvent, logInvalidChunk } from '../telemetry/loggers.js';
import { coreEvents } from '../utils/events.js';
>>>>>>> 9a7427197 (fix(billing): fix overage strategy lifecycle and settings integration (#21236))
Copy link
Contributor

Choose a reason for hiding this comment

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

security-critical critical

This file contains unresolved merge conflict markers (<<<<<<< HEAD, =======, >>>>>>>) from an incomplete cherry-pick, which will cause syntax errors and prevent the application from building. Manual resolution is required to select the correct imports. Additionally, while coreEvents is necessary, logInvalidChunk appears to be unused and should be removed if not needed.

import { logBillingEvent, logInvalidChunk } from '../telemetry/loggers.js';
import { coreEvents } from '../utils/events.js';

@github-actions
Copy link

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

@galz10 galz10 merged commit 5e80faf into release/v0.33.0-preview.8-pr-21236 Mar 10, 2026
25 checks passed
@galz10 galz10 deleted the hotfix/v0.33.0-preview.8/0.33.0-preview.9/preview/cherry-pick-9a74271/pr-21236 branch March 10, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants