Skip to content

fix(patch): cherry-pick 050c303 to release/v0.38.0-pr-25317 to patch version v0.38.0 and create version 0.38.1#25466

Merged
jerop merged 1 commit intorelease/v0.38.0-pr-25317from
hotfix/v0.38.0/0.38.1/stable/cherry-pick-050c303/pr-25317
Apr 15, 2026
Merged

fix(patch): cherry-pick 050c303 to release/v0.38.0-pr-25317 to patch version v0.38.0 and create version 0.38.1#25466
jerop merged 1 commit intorelease/v0.38.0-pr-25317from
hotfix/v0.38.0/0.38.1/stable/cherry-pick-050c303/pr-25317

Conversation

@gemini-cli-robot
Copy link
Copy Markdown
Collaborator

This PR automatically cherry-picks commit 050c303 to patch version v0.38.0 in the stable release to create version 0.38.1.

@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 introduces a patch to the stable release to improve model policy handling during plan execution. It ensures that when the system is in 'PLAN' approval mode, it consistently applies silent actions, preventing unnecessary interruptions. Additionally, it improves documentation regarding model fallback behavior and strengthens test coverage for policy resolution.

Highlights

  • Silent Action Injection: Implemented a unified silent action injection mechanism for 'PLAN' approval mode to ensure consistent behavior.
  • Documentation Update: Added documentation to clarify the automatic fallback behavior when high-reasoning models are unavailable.
  • Test Coverage: Added a new test case to verify that SILENT_ACTIONS are correctly applied when the approval mode is set to PLAN.
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.

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 implements a fallback mechanism for high-reasoning models in Plan Mode, ensuring a smoother workflow by automatically switching to faster models and applying silent actions. The changes include documentation updates, the export of silent action configurations, and new unit tests. Feedback was provided regarding a potential type safety issue in resolvePolicyChain, where the chain variable is declared as optional but used in a way that could lead to a runtime error if it remains undefined.

Comment on lines +149 to +156
if (config?.getApprovalMode?.() === ApprovalMode.PLAN) {
return chain.map((policy) => ({
...policy,
actions: { ...SILENT_ACTIONS },
}));
}

return chain;
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.

high

The implementation of the Plan Mode check introduces a potential type safety issue and maintenance risk. The chain variable is declared as ModelPolicyChain | undefined (line 48), but the function's return type is ModelPolicyChain (line 43), which is not optional.

If the condition at line 149 is false and chain remains undefined, the function will return undefined, violating its type contract. Furthermore, the use of optional chaining at line 149 (config?.getApprovalMode?.()) suggests that config could be null or undefined; if it were, the function would skip the PLAN mode block and return chain, which might be undefined. While the current logic seems to ensure chain is assigned in both the dynamic and legacy paths, the loose typing bypasses compiler checks for exhaustive assignment and could lead to a runtime crash at line 150 (chain.map) if the logic is modified in the future.

Consider tightening the type of chain to ModelPolicyChain and ensuring it is assigned in all branches, or adding an explicit guard for chain before use. This ensures the code adheres to the interface contract and explicitly handles optional properties.

References
  1. When consuming an object, if a property is optional in its type definition (interface), callers must handle the undefined case (e.g., by providing a default with ??). Do not rely on the implementation details of the function that creates the object to always provide a value, as this can change. Code against the interface contract.

@github-actions
Copy link
Copy Markdown

Size Change: +242 B (0%)

Total Size: 34 MB

Filename Size Change
./bundle/chunk-BD6RZR4Y.js 0 B -14.8 MB (removed) 🏆
./bundle/chunk-EDNUGK7Y.js 0 B -3.15 MB (removed) 🏆
./bundle/core-2UPMHOIF.js 0 B -45.4 kB (removed) 🏆
./bundle/devtoolsService-BZW5LZWI.js 0 B -28.4 kB (removed) 🏆
./bundle/interactiveCli-QDPMLOR6.js 0 B -1.65 MB (removed) 🏆
./bundle/oauth2-provider-FRVAPQIC.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-JNCBAWUY.js 3.15 MB +3.15 MB (new file) 🆕
./bundle/chunk-LWZ2IIML.js 14.8 MB +14.8 MB (new file) 🆕
./bundle/core-26ETOKLN.js 45.4 kB +45.4 kB (new file) 🆕
./bundle/devtoolsService-2QA4T7WR.js 28.4 kB +28.4 kB (new file) 🆕
./bundle/interactiveCli-73MLMFH6.js 1.65 MB +1.65 MB (new file) 🆕
./bundle/oauth2-provider-SOBLCQDL.js 9.16 kB +9.16 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
./bundle/bundled/third_party/index.js 8 MB
./bundle/chunk-34MYV7JD.js 2.45 kB
./bundle/chunk-5AUYMPVF.js 858 B
./bundle/chunk-5PS3AYFU.js 1.18 kB
./bundle/chunk-664ZODQF.js 124 kB
./bundle/chunk-DAHVX5MI.js 206 kB
./bundle/chunk-IUUIT4SU.js 56.5 kB
./bundle/chunk-RJTRUG2J.js 39.8 kB
./bundle/chunk-Z34XA6FT.js 1.96 MB
./bundle/devtools-36NN55EP.js 696 kB
./bundle/dist-T73EYRDX.js 356 B
./bundle/events-XB7DADIJ.js 418 B
./bundle/gemini.js 553 kB
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB
./bundle/memoryDiscovery-PYBLKP7S.js 980 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 222 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 229 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 13.4 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB
./bundle/src-QVCVGIUX.js 47 kB
./bundle/tree-sitter-7U6MW5PS.js 274 kB
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB

compressed-size-action

@jerop jerop enabled auto-merge (squash) April 15, 2026 16:25
@gemini-cli gemini-cli Bot added the status/need-issue Pull requests that need to have an associated issue. label Apr 15, 2026
@jerop jerop merged commit 2a28cf2 into release/v0.38.0-pr-25317 Apr 15, 2026
28 checks passed
@jerop jerop deleted the hotfix/v0.38.0/0.38.1/stable/cherry-pick-050c303/pr-25317 branch April 15, 2026 16:52
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