Skip to content

fix broken tests#24279

Merged
scidomino merged 1 commit into
mainfrom
tomm_fix
Mar 30, 2026
Merged

fix broken tests#24279
scidomino merged 1 commit into
mainfrom
tomm_fix

Conversation

@scidomino

@scidomino scidomino commented Mar 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the tests by not swallowing output in non-interactive mode.

Details

This was broken by me when I impatiently force-merged #24235 skipping the e2e tests

@scidomino scidomino requested a review from a team as a code owner March 30, 2026 22:15
@gemini-cli gemini-cli Bot added the status/need-issue Pull requests that need to have an associated issue. label Mar 30, 2026
@github-actions

Copy link
Copy Markdown

Size Change: -30 B (0%)

Total Size: 26.5 MB

Filename Size Change
./bundle/chunk-FW6HO7I7.js 0 B -3.78 MB (removed) 🏆
./bundle/chunk-MI3CKH5U.js 0 B -14.7 MB (removed) 🏆
./bundle/core-347B6MO3.js 0 B -44.5 kB (removed) 🏆
./bundle/devtoolsService-HU7SMKJU.js 0 B -28.4 kB (removed) 🏆
./bundle/interactiveCli-37AAD3D5.js 0 B -1.63 MB (removed) 🏆
./bundle/oauth2-provider-DJFNS4TO.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-O54TB7XU.js 14.7 MB +14.7 MB (new file) 🆕
./bundle/chunk-W4GRDCNX.js 3.78 MB +3.78 MB (new file) 🆕
./bundle/core-T5GOBSFE.js 44.5 kB +44.5 kB (new file) 🆕
./bundle/devtoolsService-KHSWZOW5.js 28.4 kB +28.4 kB (new file) 🆕
./bundle/interactiveCli-P34PHTSN.js 1.63 MB +1.63 MB (new file) 🆕
./bundle/oauth2-provider-W4FOEQCI.js 9.16 kB +9.16 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
./bundle/chunk-34MYV7JD.js 2.45 kB 0 B
./bundle/chunk-5AUYMPVF.js 858 B 0 B
./bundle/chunk-664ZODQF.js 124 kB 0 B
./bundle/chunk-DAHVX5MI.js 206 kB 0 B
./bundle/chunk-IUUIT4SU.js 56.5 kB 0 B
./bundle/chunk-QGLNP2IW.js 1.96 MB 0 B
./bundle/chunk-RJTRUG2J.js 39.8 kB 0 B
./bundle/chunk-U4FACSVX.js 1.13 kB 0 B
./bundle/devtools-36NN55EP.js 696 kB 0 B
./bundle/dist-T73EYRDX.js 356 B 0 B
./bundle/events-CLX3JQHP.js 418 B 0 B
./bundle/gemini.js 532 kB -54 B (-0.01%)
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB 0 B
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB 0 B
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB 0 B
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB 0 B
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB 0 B
./bundle/memoryDiscovery-XKQPPGVK.js 922 B 0 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 222 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 229 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 13.4 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
./bundle/src-QVCVGIUX.js 47 kB 0 B
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B

compressed-size-action

@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 refactors the initialization logic for the console message store to ensure it only runs when the interactive UI is active. By decoupling this from the main CLI execution flow, the changes prevent console output from being suppressed in non-interactive environments, thereby fixing existing test failures.

Highlights

  • Console Store Initialization: Moved the initialization of the console store from the main CLI entry point to the interactive UI startup process.
  • Test Stability: Ensured that console output is no longer swallowed during non-interactive mode, which resolves issues with broken tests.
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.

@jacob314 jacob314 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.

lgtm

@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 moves the initialization of the console store from the main entry point in gemini.tsx to the startInteractiveUI function in interactiveCli.tsx. Feedback was provided regarding the need to drain backlogs after initialization to ensure early messages are captured, and a concern was raised about the removal of the store initialization in the main entry point affecting expected output redirection and security.

resumedSessionData: ResumedSessionData | undefined,
initializationResult: InitializationResult,
) {
initializeConsoleStore();

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.

security-high high

The initializeConsoleStore call registers listeners for CoreEvent.ConsoleLog and CoreEvent.Output, which collect raw data. To prevent terminal injection attacks, ensure that UI components rendering these messages properly sanitize terminal control characters, treating all user-provided data as untrusted. Additionally, to ensure early startup messages are captured, explicitly drain the coreEvents backlog after initializing the store.

Suggested change
initializeConsoleStore();
initializeConsoleStore();
coreEvents.drainBacklogs();
References
  1. Always treat user-provided data as untrusted and apply proper validation and sanitization at the point of use, even if it is believed to have been filtered or sanitized upstream.

process.exit(ExitCodes.FATAL_INPUT_ERROR);
}

initializeConsoleStore();

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.

security-high high

The removal of initializeConsoleStore() in gemini.tsx is incorrect as the redirection of output to stderr is intentional and expected behavior. Reverting this change is necessary to maintain the intended architecture. Furthermore, the resulting logic that writes raw data chunks directly to stdout and stderr poses a terminal injection risk. All user-provided data must be treated as untrusted and sanitized at the point of use, following the principle of defense-in-depth.

References
  1. In gemini.tsx, the ConsolePatcher is intentionally configured with stderr: true to redirect all console output to the standard error stream; this is the expected behavior.
  2. Always treat user-provided data as untrusted and apply proper validation and sanitization at the point of use, even if it is believed to have been filtered or sanitized upstream.

@scidomino scidomino merged commit 4b20d93 into main Mar 30, 2026
29 of 30 checks passed
@scidomino scidomino deleted the tomm_fix branch March 30, 2026 22:26
scidomino added a commit that referenced this pull request Mar 31, 2026
kalenkevich pushed a commit to kalenkevich/gemini-cli that referenced this pull request Apr 3, 2026
warrenzhu25 pushed a commit to warrenzhu25/gemini-cli that referenced this pull request Apr 9, 2026
@sripasg sripasg added the size/xs An extra 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

size/xs An extra small PR 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.

4 participants