Skip to content

fix(core): preserve shell execution config fields - #25130

Closed
SH20RAJ wants to merge 3 commits into
google-gemini:mainfrom
SH20RAJ:fix-shell-exec-config-preserve-fields
Closed

fix(core): preserve shell execution config fields#25130
SH20RAJ wants to merge 3 commits into
google-gemini:mainfrom
SH20RAJ:fix-shell-exec-config-preserve-fields

Conversation

@SH20RAJ

@SH20RAJ SH20RAJ commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #25112

Summary

Preserve existing shell execution config fields when the UI refreshes layout-related values, so sandbox and background-completion settings are not dropped at runtime.

Validation

  • npm test packages/core/src/config/config.test.ts

SH20RAJ added 2 commits April 7, 2026 19:19
…ogle-gemini#24820)

- Import uiTelemetryService and call hydrate when resuming via --resume
- This ensures the session ID and metrics are correctly restored, so the quit summary shows the correct resume command

Fixes google-gemini#24820
@SH20RAJ
SH20RAJ requested a review from a team as a code owner April 10, 2026 16:50
@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 addresses an issue where specific shell execution configuration fields were being inadvertently dropped when the UI refreshed layout-related values. By updating the configuration setter to properly merge existing state and ensuring telemetry services are correctly hydrated during session resumption, the changes maintain runtime consistency for sandbox and background-completion settings.

Highlights

  • Configuration Persistence: Updated the setShellExecutionConfig method to use the spread operator, ensuring all existing shell execution fields are preserved during layout updates.
  • Telemetry Hydration: Added a call to uiTelemetryService.hydrate in the session resume hook to correctly restore session IDs and metrics.
  • Regression Testing: Added a new test case in config.test.ts to verify that sandbox and background completion settings remain intact after configuration updates.
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.

@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 introduces telemetry hydration when resuming a session and updates the Config class to ensure that shell execution configuration fields are correctly preserved during updates. A review comment suggests simplifying the setShellExecutionConfig implementation by using a standard spread-based merge instead of the current redundant approach of spreading followed by explicit field assignments for every property.

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

packages/core/src/config/config.ts (3309-3341)

high

The setShellExecutionConfig method should consistently use a merge operation (e.g., spread syntax {...a, ...b}) instead of explicit field assignment. Explicitly listing every field after a spread is redundant and can lead to accidental overwrites or order-dependent logic when new fields are added to the configuration.

References
  1. When constructing an object from multiple data sources, consistently use a merge operation (e.g., spread syntax) instead of assignment to avoid accidental overwrites and order-dependent logic.

@scidomino

Copy link
Copy Markdown
Collaborator

We already have #25113

@scidomino scidomino closed this Apr 10, 2026
@SH20RAJ

SH20RAJ commented Apr 12, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the guidance. I see that #25113 already addresses this by properly preserving shell config fields. I am closing this PR to reduce backlog and focus on active feedback. Appreciate the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m A medium sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setShellExecutionConfig() drops sandbox/background shell config fields

3 participants