Skip to content

fix(cli): use newline in shell command wrapping to avoid breaking heredocs#25537

Merged
cocosheng-g merged 16 commits intomainfrom
fix-492221980
Apr 21, 2026
Merged

fix(cli): use newline in shell command wrapping to avoid breaking heredocs#25537
cocosheng-g merged 16 commits intomainfrom
fix-492221980

Conversation

@cocosheng-g
Copy link
Copy Markdown
Contributor

@cocosheng-g cocosheng-g commented Apr 16, 2026

Summary

This pull request enhances the security, reliability, and cross-platform robustness of shell command execution.

Key Changes

  • Secure Temporary Directories: Replaced predictable temporary filenames with unique directories created via fs.mkdtempSync(). This mitigates symlink attacks, resource leaks, and prevents race conditions.
  • Command Injection Prevention: Introduced escapeShellArg to safely escape file paths before interpolating them into shell wrappers.
  • Robust Command Wrapping: Commands are now wrapped using literal newlines (e.g., {\n${command}\n}) instead of trailing semicolons. This properly supports heredocs, trailing comments, and commands ending with a backslash.
  • Cross-Platform Fixes: Ensured POSIX utility outputs (like pgrep) are parsed robustly by explicitly splitting on \n and trimming each line to handle potential \r (CRLF) carriage returns.
  • Test Suite Resiliency: Completely overhauled the shell tests by removing brittle global node:fs mocks that previously broke WASM parsing and sandbox heuristic checks on CI. Tests now dynamically capture and assert against the true generated temporary paths using resilient string matching.

fix #25536

@cocosheng-g cocosheng-g self-assigned this Apr 16, 2026
@cocosheng-g cocosheng-g marked this pull request as ready for review April 16, 2026 15:25
@cocosheng-g cocosheng-g requested review from a team as code owners April 16, 2026 15:25
@cocosheng-g
Copy link
Copy Markdown
Contributor Author

/gemini review

@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 resolves a critical issue in the CLI's shell command wrapping mechanism that previously caused heredoc commands to fail. By adjusting the command separator from a semicolon to a newline, the system now correctly processes heredocs, significantly enhancing the reliability of shell command execution within the application.

Highlights

  • Bug Fix: Fixed a bug where shell commands wrapped by the CLI would fail if they ended with a heredoc delimiter, due to an incorrectly appended semicolon.
  • Command Wrapping Logic Update: Modified the shell command wrapping logic to use a newline character ('\n') instead of a semicolon (';') before the closing brace, ensuring proper heredoc termination and valid command separation for bash.
  • New Test Cases: Added new unit tests to validate the correct handling of heredoc commands in both the CLI's useExecutionLifecycle hook and the core ShellTool.
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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 16, 2026

Size Change: +629 B (0%)

Total Size: 33.7 MB

Filename Size Change
./bundle/chunk-4KZPUKLD.js 0 B -674 kB (removed) 🏆
./bundle/chunk-6XKGCZRJ.js 0 B -2.72 MB (removed) 🏆
./bundle/chunk-CSFLEDXW.js 0 B -49.2 kB (removed) 🏆
./bundle/chunk-HJIAMJCZ.js 0 B -3.8 kB (removed) 🏆
./bundle/chunk-KPMH5OHL.js 0 B -14.5 MB (removed) 🏆
./bundle/chunk-OMLPW664.js 0 B -3.43 kB (removed) 🏆
./bundle/core-KCJ6UZXS.js 0 B -46.7 kB (removed) 🏆
./bundle/devtoolsService-UNSTBT2H.js 0 B -28.4 kB (removed) 🏆
./bundle/gemini-JKLW4OY5.js 0 B -576 kB (removed) 🏆
./bundle/interactiveCli-DXPKS52Q.js 0 B -1.3 MB (removed) 🏆
./bundle/liteRtServerManager-IULQPK32.js 0 B -2.08 kB (removed) 🏆
./bundle/oauth2-provider-L2LXI7YB.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-DH7XIIIE.js 3.8 kB +3.8 kB (new file) 🆕
./bundle/chunk-DLRSKX4P.js 14.5 MB +14.5 MB (new file) 🆕
./bundle/chunk-E5IB4HBC.js 49.2 kB +49.2 kB (new file) 🆕
./bundle/chunk-KWNML3AY.js 2.72 MB +2.72 MB (new file) 🆕
./bundle/chunk-PXVJLG72.js 3.43 kB +3.43 kB (new file) 🆕
./bundle/chunk-VE7A3IXJ.js 674 kB +674 kB (new file) 🆕
./bundle/core-37ITZ5YW.js 46.7 kB +46.7 kB (new file) 🆕
./bundle/devtoolsService-MDROW7DQ.js 28.4 kB +28.4 kB (new file) 🆕
./bundle/gemini-6X6ENSC5.js 576 kB +576 kB (new file) 🆕
./bundle/interactiveCli-YBY7BE7S.js 1.3 MB +1.3 MB (new file) 🆕
./bundle/liteRtServerManager-U5U3UR6J.js 2.08 kB +2.08 kB (new file) 🆕
./bundle/oauth2-provider-VGJ335JC.js 9.16 kB +9.16 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
./bundle/bundled/third_party/index.js 8 MB 0 B
./bundle/chunk-34MYV7JD.js 2.45 kB 0 B
./bundle/chunk-5AUYMPVF.js 858 B 0 B
./bundle/chunk-5PS3AYFU.js 1.18 kB 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-RJTRUG2J.js 39.8 kB 0 B
./bundle/chunk-YIPDXML5.js 1.97 MB 0 B
./bundle/cleanup-VY5PDR3D.js 0 B -932 B (removed) 🏆
./bundle/devtools-36NN55EP.js 696 kB 0 B
./bundle/dist-T73EYRDX.js 356 B 0 B
./bundle/events-XB7DADIJ.js 418 B 0 B
./bundle/examples/hooks/scripts/on-start.js 188 B 0 B
./bundle/examples/mcp-server/example.js 1.43 kB 0 B
./bundle/gemini.js 4.97 kB 0 B
./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-NXEEFR74.js 980 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/start-N46YKBAM.js 0 B -622 B (removed) 🏆
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B
./bundle/cleanup-4ACZZU5W.js 932 B +932 B (new file) 🆕
./bundle/start-R7F3ON3B.js 622 B +622 B (new file) 🆕

compressed-size-action

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 modifies the shell command wrapping logic to use newlines instead of semicolons, which improves support for heredocs and multi-line commands. Feedback identifies a security vulnerability due to predictable temporary file paths and suggests using fs.mkdtempSync() as per repository rules. Additionally, it recommends adding a newline after the opening brace of the command wrapper to prevent potential issues with backslashes or comments, along with updating the relevant tests.

Comment thread packages/cli/src/ui/hooks/useExecutionLifecycle.ts Outdated
Comment thread packages/cli/src/ui/hooks/useExecutionLifecycle.test.tsx Outdated
Comment thread packages/cli/src/ui/hooks/useExecutionLifecycle.test.tsx Outdated
Comment thread packages/cli/src/ui/hooks/useExecutionLifecycle.test.tsx Outdated
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 improves shell command wrapping in the useExecutionLifecycle hook and shell tools to correctly handle heredocs. By replacing conditional semicolon appending with a mandatory newline before the closing brace or parenthesis, the changes ensure that heredoc delimiters are properly recognized by the shell. New test cases were added to both the CLI and Core packages to verify this behavior. I have no feedback to provide as no review comments were present.

@gemini-cli gemini-cli Bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Apr 16, 2026
@cocosheng-g
Copy link
Copy Markdown
Contributor Author

/gemini review

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 enhances the security and reliability of shell command execution by utilizing unique temporary directories for capturing the working directory and process IDs. It also improves command wrapping to correctly handle heredocs and trailing backslashes by using newlines. Review feedback identifies a non-deterministic test in shell.test.ts caused by the lack of mocking for fsPromises.mkdtemp, and a potential command injection vulnerability where temporary file paths are interpolated into shell strings without adequate escaping.

I am having trouble creating individual review comments. Click here to see my feedback.

packages/core/src/tools/shell.test.ts (512)

critical

The test assertions in this file rely on a hardcoded temporary directory name (gemini-shell-abcdef). However, the implementation in shell.ts now uses fsPromises.mkdtemp, which generates a directory with a random suffix, making this test non-deterministic and likely to fail.

To fix this, please mock fsPromises.mkdtemp to return a predictable path, similar to how fs.mkdtempSync is mocked in useExecutionLifecycle.test.tsx.

You can add the following to your test setup:

import * as fsPromises from 'node:fs/promises';
vi.mock('node:fs/promises');

// In beforeEach:
vi.mocked(fsPromises.mkdtemp).mockResolvedValue(
  path.join(os.tmpdir(), 'gemini-shell-abcdef')
);

This will ensure your tests are reliable and correctly verify the new implementation.

References
  1. In tests, prefer using hardcoded literal values instead of importing constants to ensure tests are self-contained and less brittle.

packages/cli/src/ui/hooks/useExecutionLifecycle.ts (373)

security-high high

The pwdFilePath variable is interpolated into a shell command string using double quotes: pwd > "${pwdFilePath}". While double quotes prevent word splitting (handling spaces), they do not prevent command substitution in shells like bash. Since pwdFilePath is derived from os.tmpdir() (which is influenced by the TMPDIR environment variable), an attacker who can control environment variables could achieve command injection by including $(...) or backticks in the temporary directory path.

Although this is a CLI tool where the user typically has full shell access, this vulnerability could be exploited in restricted environments (e.g., shared systems, web-based terminals, or restricted CI/CD pipelines) where a user might be able to set environment variables but is otherwise restricted from running arbitrary commands. Additionally, a similar unquoted usage exists in packages/core/src/tools/shell.ts (line 114), which is also vulnerable to word splitting if the path contains spaces.

References
  1. When creating temporary files or directories in global temporary directories (e.g., /tmp), use fs.mkdtempSync() to generate securely named, uniquely named temporary directories to mitigate symlink attacks.

@cocosheng-g
Copy link
Copy Markdown
Contributor Author

/gemini review

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 enhances the security and reliability of shell command execution by replacing predictable temporary filenames with unique directories created via mkdtemp. It also introduces shell argument escaping and improves the wrapping of commands to correctly handle heredocs and trailing backslashes. The review feedback identifies potential resource leaks where temporary directories are created outside of try-finally blocks, and recommends using fs.mkdtempSync instead of fsPromises.mkdtemp to align with security best practices for global temporary directories.

Comment thread packages/cli/src/ui/hooks/useExecutionLifecycle.ts Outdated
Comment thread packages/core/src/tools/shell.ts Outdated
@cocosheng-g
Copy link
Copy Markdown
Contributor Author

/gemini review

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 improves the security and robustness of shell command execution by using fs.mkdtempSync for temporary directories and escapeShellArg for file paths, replacing the previous crypto-based random filename approach. It also refactors the command wrapping logic in useExecutionLifecycle and ShellToolInvocation to ensure proper cleanup of temporary resources. Feedback was provided regarding the parsing of pgrep output, suggesting that lines should be trimmed to handle potential carriage returns when splitting by \n to avoid regex mismatches.

Comment thread packages/core/src/tools/shell.ts Outdated
@cocosheng-g
Copy link
Copy Markdown
Contributor Author

/gemini review

@github-actions
Copy link
Copy Markdown

🛑 Action Required: Evaluation Approval

Steering changes have been detected in this PR. To prevent regressions, a maintainer must approve the evaluation run before this PR can be merged.

Maintainers:

  1. Go to the Workflow Run Summary.
  2. Click the yellow 'Review deployments' button.
  3. Select the 'eval-gate' environment and click 'Approve'.

Once approved, the evaluation results will be posted here automatically.

@cocosheng-g cocosheng-g added this pull request to the merge queue Apr 21, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 21, 2026
@cocosheng-g cocosheng-g added this pull request to the merge queue Apr 21, 2026
Merged via the queue into main with commit 93a8d90 Apr 21, 2026
28 of 29 checks passed
@cocosheng-g cocosheng-g deleted the fix-492221980 branch April 21, 2026 19:28
ik-gemini-bot added a commit to spigell/gemini-cli that referenced this pull request May 3, 2026
* refactor(plan): simplify policy priorities and consolidate read-only rules (google-gemini#24849)

* feat(test-utils): add memory usage integration test harness (google-gemini#24876)

* feat(memory): add /memory inbox command for reviewing extracted skills (google-gemini#24544)

* chore(release): bump version to 0.39.0-nightly.20260408.e77b22e63 (google-gemini#24939)

* fix(core): ensure robust sandbox cleanup in all process execution paths (google-gemini#24763)

Co-authored-by: Spencer <spencertang@google.com>

* chore: update ink version to 6.6.8 (google-gemini#24934)

* Changelog for v0.38.0-preview.0 (google-gemini#24938)

Co-authored-by: gemini-cli-robot <224641728+gemini-cli-robot@users.noreply.github.com>
Co-authored-by: g-samroberts <samroberts@google.com>

* chore: ignore conductor directory (google-gemini#22128)

Co-authored-by: Coco Sheng <cocosheng@google.com>

* Changelog for v0.37.0 (google-gemini#24940)

Co-authored-by: gemini-cli-robot <224641728+gemini-cli-robot@users.noreply.github.com>
Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com>

* feat(plan): require user confirmation for activate_skill in Plan Mode (google-gemini#24946)

* feat(test-utils): add CPU performance integration test harness (google-gemini#24951)

* fix(core): resolve windows symlink bypass and stabilize sandbox integration tests (google-gemini#24834)

* test(sdk): add unit tests for GeminiCliSession (google-gemini#21897)

* fix(cli): restore file path display in edit and write tool confirmations (google-gemini#24974)

* fix(cli-ui): enable Ctrl+Backspace for word deletion in Windows Terminal (google-gemini#21447)

* fix(core): dynamic session ID injection to resolve resume bugs (google-gemini#24972)

* Update ink version to 6.6.9 (google-gemini#24980)

* feat(core): refine shell tool description display logic (google-gemini#24903)

* Generalize evals infra to support more types of evals, organization and queuing of named suites (google-gemini#24941)

* fix(cli): optimize startup with lightweight parent process (google-gemini#24667)

* refactor(sandbox): use centralized sandbox paths in macOS Seatbelt implementation (google-gemini#24984)

* feat(cli): refine tool output formatting for compact mode (google-gemini#24677)

* fix(sdk): skip broken sendStream tests to unblock nightly (google-gemini#25000)

* refactor(core): use centralized path resolution for Linux sandbox (google-gemini#24985)

* Support ctrl+shift+g (google-gemini#25035)

* feat(core): refactor subagent tool to unified invoke_subagent tool (google-gemini#24489)

* fix(core): add explicit git identity env vars to prevent sandbox checkpointing error (google-gemini#19775)

Co-authored-by: David Pierce <davidapierce@google.com>

* fix: respect hideContextPercentage when FooterConfigDialog is closed without changes (google-gemini#24773)

Co-authored-by: Coco Sheng <cocosheng@google.com>

* fix(cli): suppress unhandled AbortError logs during request cancellation (google-gemini#22621)

* Automated documentation audit (google-gemini#24567)

* feat(cli): implement useAgentStream hook (google-gemini#24292)

Co-authored-by: Adam Weidman <adamfweidman@gmail.com>
Co-authored-by: Adam Weidman <adamfweidman@google.com>

* refactor(core): remove legacy subagent wrapping tools (google-gemini#25053)

* refactor(plan) Clean default plan toml (google-gemini#25037)

* fix(core): honor retryDelay in RetryInfo for 503 errors (google-gemini#25057)

* fix(core): remediate subagent memory leaks using AbortSignal in MessageBus (google-gemini#25048)

* feat(cli): wire up useAgentStream in AppContainer (google-gemini#24297)

Co-authored-by: Adam Weidman <adamfweidman@gmail.com>
Co-authored-by: Adam Weidman <adamfweidman@google.com>

* feat(core): migrate chat recording to JSONL streaming (google-gemini#23749)

* fix(core): clear 5-minute timeouts in oauth flow to prevent memory leaks (google-gemini#24968)

* fix(sandbox): centralize async git worktree resolution and enforce read-only security (google-gemini#25040)

* feat(test): add high-volume shell test and refine perf harness (google-gemini#24983)

* fix(core): silently handle EPERM when listing dir structure (google-gemini#25066)

* Changelog for v0.37.1 (google-gemini#25055)

Co-authored-by: gemini-cli-robot <224641728+gemini-cli-robot@users.noreply.github.com>

* fix: decode Uint8Array and multi-byte UTF-8 in API error messages (google-gemini#23341)

Co-authored-by: Coco Sheng <cocosheng@google.com>

* Automated documentation audit results (google-gemini#22755)

* debugging(ui): add optional debugRainbow setting (google-gemini#25088)

* fix: resolve lifecycle memory leaks by cleaning up listeners and root closures (google-gemini#25049)

* docs(cli): updates f12 description to be more precise (google-gemini#15816)

* fix(cli): mark /settings as unsafe to run concurrently (google-gemini#25061)

* fix(core): remove buffer slice to prevent OOM on large output streams (google-gemini#25094)

* feat(core): persist subagent agentId in tool call records (google-gemini#25092)

* chore(core): increase codebase investigator turn limits to 50 (google-gemini#25125)

* refactor(core): consolidate execute() arguments into ExecuteOptions (google-gemini#25101)

* feat(core): add Strategic Re-evaluation guidance to system prompt (google-gemini#25062)

* fix(core): preserve shell execution config fields on update (google-gemini#25113)

* docs: add vi shortcuts and clarify MCP sandbox setup (google-gemini#21679)

Co-authored-by: Jenna Inouye <jinouye@google.com>

* fix(cli): pass session id to interactive shell executions (google-gemini#25114)

* fix(cli): resolve text sanitization data loss due to C1 control characters (google-gemini#22624)

* feat(core): add large memory regression test (google-gemini#25059)

* fix(core): resolve PTY exhaustion and orphan MCP subprocess leaks (google-gemini#25079)

* chore: switch from keytar to @github/keytar (google-gemini#25143)

* chore(deps): update vulnerable dependencies via npm audit fix (google-gemini#25140)

* perf(sandbox): optimize Windows sandbox initialization via native ACL application (google-gemini#25077)

* fix: improve audio MIME normalization and validation in file reads (google-gemini#21636)

Co-authored-by: Coco Sheng <cocosheng@google.com>

* docs: Update docs-audit to include changes in PR body (google-gemini#25153)

* docs: correct documentation for enforced authentication type (google-gemini#25142)

* fix(cli): exclude update_topic from confirmation queue count (google-gemini#24945)

* Memory fix for trace's streamWrapper. (google-gemini#25089)

* fix(core): fix quota footer for non-auto models and improve display (google-gemini#25121)

* docs(contributing): clarify self-assignment policy for issues (google-gemini#23087)

* feat(core): add skill patching support with /memory inbox integration (google-gemini#25148)

* Stop suppressing thoughts and text in model response (google-gemini#25073)

* fix(release): prefix git hash in nightly versions to prevent semver normalization (google-gemini#25304)

* feat(cli): extract QuotaContext and resolve infinite render loop (google-gemini#24959)

* refactor(core): extract and centralize sandbox path utilities (google-gemini#25305)

Co-authored-by: David Pierce <davidapierce@google.com>

* feat(ui): added enhancements to scroll momentum (google-gemini#24447)

* fix(core): replace custom binary detection with isbinaryfile to correctly handle UTF-8 (U+FFFD) (google-gemini#25297)

* feat(agent): implement tool-controlled display protocol (Steps 2-3) (google-gemini#25134)

* Stop showing scrollbar unless we are in terminalBuffer mode (google-gemini#25320)

* fix(core): expose GEMINI_PLANS_DIR to hook environment (google-gemini#25296)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* feat: support auth block in MCP servers config in agents (google-gemini#24770)

* feat(core): implement silent fallback for Plan Mode model routing (google-gemini#25317)

* fix: correct redirect count increment in fetchJson (google-gemini#24896)

Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>

* fix(core): prevent secondary crash in ModelRouterService finally block (google-gemini#25333)

* feat(core): introduce decoupled ContextManager and Sidecar architecture (google-gemini#24752)

* docs(core): update generalist agent documentation (google-gemini#25325)

* chore(mcp): check MCP error code over brittle string match (google-gemini#25381)

* test(core): improve sandbox integration test coverage and fix OS-specific failures (google-gemini#25307)

Co-authored-by: David Pierce <davidapierce@google.com>

* feat(plan): update plan mode prompt to allow showing plan content (google-gemini#25058)

* fix(core): use debug level for keychain fallback logging (google-gemini#25398)

* feat(test): add a performance test in asian language (google-gemini#25392)

* feat(cli): enable mouse clicking for cursor positioning in AskUser multi-line answers (google-gemini#24630)

* fix(core): detect kmscon terminal as supporting true color (google-gemini#25282)

Co-authored-by: Adib234 <30782825+Adib234@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* ci: add agent session drift check workflow (google-gemini#25389)

* use macos-latest-large runner where applicable. (google-gemini#25413)

* Changelog for v0.37.2 (google-gemini#25336)

Co-authored-by: gemini-cli-robot <224641728+gemini-cli-robot@users.noreply.github.com>

* chore(release): bump version to 0.40.0-nightly.20260414.g5b1f7375a (google-gemini#25420)

* Fix(core): retry additional OpenSSL 3.x SSL errors during streaming (google-gemini#16075) (google-gemini#25187)

* fix(core): prevent YOLO mode from being downgraded (google-gemini#25341)

* feat: bundle ripgrep binaries into SEA for offline support (google-gemini#25342)

* Changelog for v0.39.0-preview.0 (google-gemini#25417)

Co-authored-by: gemini-cli-robot <224641728+gemini-cli-robot@users.noreply.github.com>
Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com>

* feat(test): add large conversation scenario for performance test (google-gemini#25331)

* improve(core): require recurrence evidence before extracting skills (google-gemini#25147)

* test(evals): add subagent delegation evaluation tests (google-gemini#24619)

* feat: add github colorblind themes (google-gemini#15504)

Co-authored-by: Coco Sheng <cocosheng@google.com>

* fix(core): honor GOOGLE_GEMINI_BASE_URL and GOOGLE_VERTEX_BASE_URL (google-gemini#25357)

* fix(cli): clean up slash command IDE listeners (google-gemini#24397)

Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>

* Changelog for v0.38.0 (google-gemini#25470)

Co-authored-by: gemini-cli-robot <224641728+gemini-cli-robot@users.noreply.github.com>

* fix(evals): update eval tests for invoke_agent telemetry and project-scoped memory (google-gemini#25502)

* Changelog for v0.38.1 (google-gemini#25476)

Co-authored-by: gemini-cli-robot <224641728+gemini-cli-robot@users.noreply.github.com>
Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com>

* feat(core): integrate skill-creator into skill extraction agent (google-gemini#25421)

* feat(cli): provide default post-submit prompt for skill command (google-gemini#25327)

* feat(core): add tools to list and read MCP resources (google-gemini#25395)

* fix(evals): add typecheck coverage for evals, integration-tests, and memory-tests (google-gemini#25480)

* Use OSC 777 for terminal notifications (google-gemini#25300)

* fix(extensions): fix bundling for examples (google-gemini#25542)

* fix(cli): reset plan session state on /clear (google-gemini#25515)

* feat(core): add .mdx support to get-internal-docs tool (google-gemini#25090)

* docs(policy): mention that workspace policies are broken (google-gemini#24367)

Co-authored-by: Nicolas Ouellet-Payeur <nicolaso@chromium.org>

* fix(core): allow explicit write permissions to override governance file protections in sandboxes (google-gemini#25338)

* feat(sandbox): resolve custom seatbelt profiles from $HOME/.gemini first (google-gemini#25427)

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>

* Reduce blank lines. (google-gemini#25563)

* fix(ui): revert preview theme on dialog unmount (google-gemini#22542)

Co-authored-by: Jack Wotherspoon <jackwoth@google.com>

* fix(core): fix ShellExecutionConfig spread and add ProjectRegistry save backoff (google-gemini#25382)

* feat(core): Disable topic updates for subagents (google-gemini#25567)

* feat(core): enable topic update narration by default and promote to general (google-gemini#25586)

Co-authored-by: JAYADITYA <96861162+JayadityaGit@users.noreply.github.com>
Co-authored-by: Jack Wotherspoon <jackwoth@google.com>

* docs: migrate installation and authentication to mdx with tabbed layouts (google-gemini#25155)

* feat(config): split memoryManager flag into autoMemory (google-gemini#25601)

* fix(core): allow Cloud Shell users to use PRO_MODEL_NO_ACCESS experiment (google-gemini#25702)

* fix(cli): round slow render latency to avoid opentelemetry float warning (google-gemini#25709)

* docs(tracker): introduce experimental task tracker feature (google-gemini#24556)

* docs(cli): fix inconsistent system.md casing in system prompt docs (google-gemini#25414)

Co-authored-by: cynthialong0-0 <82900738+cynthialong0-0@users.noreply.github.com>

* feat(cli): add streamlined `gemini gemma` local model setup (google-gemini#25498)

Co-authored-by: Abhijit Balaji <abhijitbalaji@google.com>
Co-authored-by: Samee Zahid <sameez@google.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Changelog for v0.38.2 (google-gemini#25593)

Co-authored-by: gemini-cli-robot <224641728+gemini-cli-robot@users.noreply.github.com>

* Fix: Disallow overriding IDE stdio via workspace .env (RCE) (google-gemini#25022)

Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>

* feat(test): refactor the memory usage test to use metrics from CLI process instead of test runner (google-gemini#25708)

* feat(vertex): add settings for Vertex AI request routing (google-gemini#25513)

* Fix/allow for session persistence (google-gemini#25176)

* fix(core): resolve nested plan directory duplication and relative path policies (google-gemini#25138)

* feat: detect new files in @ recommendations with watcher based updates (google-gemini#25256)

* Allow dots on GEMINI_API_KEY (google-gemini#25497)

* feat(telemetry): add flag for enabling traces specifically (google-gemini#25343)

* fix(cli): use newline in shell command wrapping to avoid breaking heredocs (google-gemini#25537)

* fix(cli): ensure theme dialog labels are rendered for all themes (google-gemini#24599)

Co-authored-by: cynthialong0-0 <82900738+cynthialong0-0@users.noreply.github.com>

* fix(core): disable detached mode in Bun to prevent immediate SIGHUP of child processes (google-gemini#22620)

* feat: add /new as alias for /clear and refine command description (google-gemini#17865)

* fix(cli): start auto memory in ACP sessions (google-gemini#25626)

* fix(core): remove duplicate initialize call on agents refreshed (google-gemini#25670)

* test(e2e): default integration tests to Flash Preview (google-gemini#25753)

* refactor(memory): replace MemoryManagerAgent with prompt-driven memory editing across four tiers (google-gemini#25716)

* fix(cli): fix "/clear (new)" command (google-gemini#25801)

* fix(core): use dynamic CLI version for IDE client instead of hardcoded '1.0.0' (google-gemini#24414)

Co-authored-by: cynthialong0-0 <82900738+cynthialong0-0@users.noreply.github.com>

* fix(core): handle line endings in ignore file parsing (google-gemini#23895)

Co-authored-by: cynthialong0-0 <82900738+cynthialong0-0@users.noreply.github.com>

* Fix/command injection shell (google-gemini#24170)

Co-authored-by: David Pierce <davidapierce@google.com>

* fix(ui): removed background color for input (google-gemini#25339)

* fix(devtools): reduce memory usage and defer connection (google-gemini#24496)

* fix(core): support jsonl session logs in memory and summary services (google-gemini#25816)

* fix(release): exclude ripgrep binaries from npm tarballs (google-gemini#25841)

* chore(release): v0.40.0-preview.2

* feat(cli): secure .env loading and enforce workspace trust in headless mode (google-gemini#25814)

Co-authored-by: galz10 <galzahavi@google.com>
Co-authored-by: davidapierce <davidapierce@google.com>

* feat(core): enhance shell command validation and add core tools allowlist (google-gemini#25720)

Co-authored-by: David Pierce <davidapierce@google.com>
Co-authored-by: Keith Schaab <keithsc@google.com>
Co-authored-by: Keith Schaab <keith.schaab@gmail.com>
Co-authored-by: Emily Hedlund <ehedlund@google.com>

* update FatalUntrustedWorkspaceError message to include doc link (google-gemini#25874)

* chore(release): v0.40.0-preview.3

* fix(patch): cherry-pick 048bf6e to release/v0.40.0-preview.3-pr-25941 to patch version v0.40.0-preview.3 and create version 0.40.0-preview.4 (google-gemini#25942)

Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>

* chore(release): v0.40.0-preview.4

* fix(patch): cherry-pick 54b7586 to release/v0.40.0-preview.4-pr-26066 [CONFLICTS] (google-gemini#26124)

Co-authored-by: David Pierce <davidapierce@google.com>

* chore(release): v0.40.0-preview.5

* chore(release): v0.40.0

* Remove temporary commit message file from tracking

This cleans the repository after the upstream merge and ignores the helper file so future local commits do not pollute branch diffs.

* Add optional image build trigger to fork resync skill

Document the final workflow trigger step for cases where a new container image is required, including the exact workflow name and inputs, and warn against passing the branch name as the version.

* Clarify fork bump behavior in resync skill

Document that the fork should be bumped from upstream without applying fork patches back onto the upstream release branch, keeping fork-specific changes isolated to the fork resync workflow.

---------

Co-authored-by: ruomeng <ruomeng@google.com>
Co-authored-by: Sri Pasumarthi <111310667+sripasg@users.noreply.github.com>
Co-authored-by: Sandy Tao <sandytao520@icloud.com>
Co-authored-by: gemini-cli-robot <gemini-cli-robot@google.com>
Co-authored-by: Emily Hedlund <ehedlund@google.com>
Co-authored-by: Spencer <spencertang@google.com>
Co-authored-by: Jacob Richman <jacob314@gmail.com>
Co-authored-by: gemini-cli-robot <224641728+gemini-cli-robot@users.noreply.github.com>
Co-authored-by: g-samroberts <samroberts@google.com>
Co-authored-by: JAYADITYA <96861162+JayadityaGit@users.noreply.github.com>
Co-authored-by: Coco Sheng <cocosheng@google.com>
Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com>
Co-authored-by: Adamya Singh <adamyasingh54@gmail.com>
Co-authored-by: Jarrod Whelan <150866123+jwhelangoog@users.noreply.github.com>
Co-authored-by: dogukanozen <dogukannozen@hotmail.com>
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
Co-authored-by: Christian Gunderman <gundermanc@google.com>
Co-authored-by: Sehoon Shon <sshon@google.com>
Co-authored-by: Abhi <43648792+abhipatel12@users.noreply.github.com>
Co-authored-by: MD. MOHIBUR RAHMAN <35300157+mrpmohiburrahman@users.noreply.github.com>
Co-authored-by: David Pierce <davidapierce@google.com>
Co-authored-by: chernistry <73943355+chernistry@users.noreply.github.com>
Co-authored-by: euxaristia <25621994+euxaristia@users.noreply.github.com>
Co-authored-by: Michael Bleigh <mbleigh@mbleigh.com>
Co-authored-by: Adam Weidman <adamfweidman@gmail.com>
Co-authored-by: Adam Weidman <adamfweidman@google.com>
Co-authored-by: Yuna Seol <yunaseol@gmail.com>
Co-authored-by: June <kimjune01@gmail.com>
Co-authored-by: Aishanee Shah <aishaneeshah@google.com>
Co-authored-by: Jason Matthew Suhari <jasonmatthewsuhari@gmail.com>
Co-authored-by: Christopher Thomas <cobekgn@gmail.com>
Co-authored-by: Jenna Inouye <jinouye@google.com>
Co-authored-by: cynthialong0-0 <82900738+cynthialong0-0@users.noreply.github.com>
Co-authored-by: M Junaid Shaukat <154750865+junaiddshaukat@users.noreply.github.com>
Co-authored-by: Abhijit Balaji <abhijitbalaji@google.com>
Co-authored-by: Mark Griffith <anthraxmilkshake@hotmail.com>
Co-authored-by: Jack Wotherspoon <jackwoth@google.com>
Co-authored-by: Jesse Rosenstock <jesse.rosenstock@gmail.com>
Co-authored-by: Adib234 <30782825+Adib234@users.noreply.github.com>
Co-authored-by: Dev Randalpura <devrandalpura@google.com>
Co-authored-by: Anjaligarhwal <anjaligarhwal1610@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Tanmay Vartak <9002434+TanmayVartak@users.noreply.github.com>
Co-authored-by: Jerop Kipruto <jerop@google.com>
Co-authored-by: Kevin Zhao <kevin8093@126.com>
Co-authored-by: joshualitt <joshualitt@google.com>
Co-authored-by: Clay <claygeo6@gmail.com>
Co-authored-by: Adam Weidman <65992621+adamfweidman@users.noreply.github.com>
Co-authored-by: Rob Clevenger <rcleveng@users.noreply.github.com>
Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com>
Co-authored-by: anj-s <32556631+anj-s@users.noreply.github.com>
Co-authored-by: Z1xus <40185941+Z1xus@users.noreply.github.com>
Co-authored-by: jackyliuxx <jackyliuxx@gmail.com>
Co-authored-by: Nicolas Ouellet-Payeur <nicolaso@google.com>
Co-authored-by: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Mahima Shanware <mahima.shanware@gmail.com>
Co-authored-by: Timo <36011879+Bodlux@users.noreply.github.com>
Co-authored-by: Samee Zahid <sameescouser24@gmail.com>
Co-authored-by: Samee Zahid <sameez@google.com>
Co-authored-by: Mundur <150439604+M0nd0R@users.noreply.github.com>
Co-authored-by: Gordon Hui <125633533+gordonhwc@users.noreply.github.com>
Co-authored-by: Muhammad Ahsan Farooq <ahsanfarooq210@gmail.com>
Co-authored-by: PRAS Samin <103464543+prassamin@users.noreply.github.com>
Co-authored-by: Danyel Cabello <danyel.nerv@gmail.com>
Co-authored-by: Vedant Mahajan <vedant.04.mahajan@gmail.com>
Co-authored-by: mini2s <143020328+mini2s@users.noreply.github.com>
Co-authored-by: Kishan Patel <132991737+thekishandev@users.noreply.github.com>
Co-authored-by: xoma-zver <maxidiplomat@gmail.com>
Co-authored-by: Horizon_Architect_07 <famousrajbhatt@gmail.com>
Co-authored-by: galz10 <galzahavi@google.com>
Co-authored-by: Keith Schaab <keithsc@google.com>
Co-authored-by: Keith Schaab <keith.schaab@gmail.com>
Co-authored-by: codex-bot <spigelly+gh-bot@gmail.com>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix shell command wrapping breaking heredocs

3 participants