fix(acp): --experimental-acp no longer stops the world in tty mode#10089
fix(acp): --experimental-acp no longer stops the world in tty mode#10089sillyDaibo wants to merge 4 commits intogoogle-gemini:mainfrom
--experimental-acp no longer stops the world in tty mode#10089Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @sillyDaibo, 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 where enabling the Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This change correctly prevents the CLI from entering interactive mode when --experimental-acp is used in a TTY, which fixes the reported terminal freeze. The logic is sound and the fix is well-targeted. To ensure this fix is permanent and to prevent future regressions, I've suggested adding a unit test.
| const interactive = | ||
| !!argv.promptInteractive || | ||
| (process.stdin.isTTY && !hasPromptWords && !argv.prompt); | ||
| (process.stdin.isTTY && | ||
| !hasPromptWords && | ||
| !argv.prompt && | ||
| !argv.experimentalAcp); |
There was a problem hiding this comment.
This change correctly makes the CLI non-interactive when --experimental-acp is passed. To prevent future regressions for this bug fix, please add a unit test that verifies this new behavior.
You can add a test case to packages/cli/src/config/config.test.ts inside the loadCliConfig interactive describe block, like this:
it('should not be interactive if --experimental-acp is set, even in a TTY', async () => {
process.stdin.isTTY = true;
process.argv = ['node', 'script.js', '--experimental-acp'];
const argv = await parseArguments({} as Settings);
const config = await loadCliConfig({}, [], 'test-session', argv);
expect(config.isInteractive()).toBe(false);
});|
Hi @sillyDaibo, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
|
Thank you for submission to the Gemini CLI project. At this time, we are closing this pull request in order to allow us to better triage and support more recent pull requests against the latest code changes. If you feel like this pull request is a critical contribution to the Gemini CLI project, please associate the pull request with an existing GitHub issue (instructions here: https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue) before reopening. After Monday January 26 2026, any pull requests submitted by contributors without an associated issue will be automatically closed (more information here: #16706). If you do choose to reopen and submit this pull request, please ensure you rebase your changes onto the current main branch before resubmitting. This will help avoid merge conflicts and ensure your contribution is compatible with the latest codebase. |
TLDR
When running
gemini --experimental-acpin tty mode (e.g. in your bash), the terminal will totally freeze in 2 seconds, and even Ctrl-C cannot be sent to it.If you run docker with
-tto enable tty and--experimental-acpto enable acp mode, the problem also exists. Removing-tcan bypass the problem, but sometimes we still want to debug in tty mode.This pr fixes the problem with only one-line modification, thus it's only a small and safe fix. I've tested it on linux and through docker, both works perfectly.
Dive Deeper
Reviewer Test Plan
Testing Matrix
Linked issues / bugs