Skip to content

fix(patch): cherry-pick 0ded546 to release/v0.10.0-preview.1-pr-11225 to patch version v0.10.0-preview.1 and create version 0.10.0-preview.2#11415

Merged
skeshive merged 1 commit into
release/v0.10.0-preview.1-pr-11225from
hotfix/v0.10.0-preview.1/0.10.0-preview.2/preview/cherry-pick-0ded546/pr-11225
Oct 17, 2025
Merged

fix(patch): cherry-pick 0ded546 to release/v0.10.0-preview.1-pr-11225 to patch version v0.10.0-preview.1 and create version 0.10.0-preview.2#11415
skeshive merged 1 commit into
release/v0.10.0-preview.1-pr-11225from
hotfix/v0.10.0-preview.1/0.10.0-preview.2/preview/cherry-pick-0ded546/pr-11225

Conversation

@skeshive

Copy link
Copy Markdown
Contributor

This PR automatically cherry-picks commit 0ded546 to patch version v0.10.0-preview.1 in the preview release to create version 0.10.0-preview.2.

@skeshive skeshive requested a review from a team as a code owner October 17, 2025 20:50
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @skeshive, 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 enhances the application's ability to handle interactive shell commands by integrating pseudo-terminal (PTY) information into its configuration. This allows for more adaptive user guidance regarding interactive commands, ensuring that users receive appropriate instructions for input in interactive environments or are reminded to avoid such commands when not supported. The changes are part of a routine patch release to improve the overall user experience with shell interactions.

Highlights

  • Patch Release Cherry-Pick: This pull request is an automated cherry-pick of commit 0ded546a09c1e9255f3337da2e290affa8164022 to create a new patch version v0.10.0-preview.2 from v0.10.0-preview.1.
  • Interactive Shell Support: Introduced logic to detect and manage interactive shell environments by integrating PTY (pseudo-terminal) information into the application's configuration. This includes importing getPty and passing its information to the Config object.
  • Dynamic Prompt Guidance: The system prompt's guidance for interactive commands has been updated to be dynamic. If an interactive shell is enabled, it now advises users to press ctrl + f to focus into the shell for input; otherwise, it maintains the previous instruction to avoid interactive commands.
  • Configuration Enhancements: The Config interface and class in the core package have been extended to include an optional ptyInfo string and a new isInteractiveShellEnabled() method to determine the interactive shell status.
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.

@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 is a cherry-pick that introduces support for interactive shell commands by detecting PTY capabilities and adjusting the system prompt accordingly. The core logic seems sound, introducing a new isInteractiveShellEnabled method in the Config class and dynamically generating the prompt for interactive commands. However, I've found a significant issue in a new test case meant to verify the behavior for non-interactive shells. The test is not correctly mocking the conditions, leading it to test the wrong logic branch and pass incorrectly. My review comment provides a fix for this test.

Comment on lines +137 to +143
it('should return the interactive avoidance prompt when in non-interactive mode', () => {
vi.stubEnv('SANDBOX', undefined);
mockConfig.isInteractive = vi.fn().mockReturnValue(false);
const prompt = getCoreSystemPrompt(mockConfig, '');
expect(prompt).toContain('**Interactive Commands:**'); // Check for interactive prompt
expect(prompt).toMatchSnapshot(); // Use snapshot for base prompt structure
});

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 test case should return the interactive avoidance prompt when in non-interactive mode has a flaw in its setup. It mocks isInteractive to false, but the logic in getCoreSystemPrompt depends on config.isInteractiveShellEnabled(). Since the beforeEach block mocks isInteractiveShellEnabled to always return true, changing isInteractive has no effect on the test's outcome.

To correctly test the 'avoidance' prompt, you should mock isInteractiveShellEnabled to return false. This will ensure you are testing the correct branch of the conditional logic in prompts.ts. After applying this change, the snapshot for this test will need to be updated.

Suggested change
it('should return the interactive avoidance prompt when in non-interactive mode', () => {
vi.stubEnv('SANDBOX', undefined);
mockConfig.isInteractive = vi.fn().mockReturnValue(false);
const prompt = getCoreSystemPrompt(mockConfig, '');
expect(prompt).toContain('**Interactive Commands:**'); // Check for interactive prompt
expect(prompt).toMatchSnapshot(); // Use snapshot for base prompt structure
});
it('should return the interactive avoidance prompt when interactive shell is disabled', () => {
vi.stubEnv('SANDBOX', undefined);
mockConfig.isInteractiveShellEnabled = vi.fn().mockReturnValue(false);
const prompt = getCoreSystemPrompt(mockConfig, '');
expect(prompt).toContain('**Interactive Commands:**'); // Check for interactive prompt
expect(prompt).toMatchSnapshot(); // Use snapshot for base prompt structure
});

@github-actions

Copy link
Copy Markdown

Size Change: +788 B (0%)

Total Size: 17.8 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 17.8 MB +788 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 830 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-closed.sb 3.29 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

compressed-size-action

@skeshive skeshive enabled auto-merge (squash) October 17, 2025 20:52
@skeshive skeshive merged commit a186083 into release/v0.10.0-preview.1-pr-11225 Oct 17, 2025
20 checks passed
@skeshive skeshive deleted the hotfix/v0.10.0-preview.1/0.10.0-preview.2/preview/cherry-pick-0ded546/pr-11225 branch October 17, 2025 20:57
@sripasg sripasg added the size/m A medium sized 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/m A medium sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants