Skip to content

fix(acp): --experimental-acp no longer stops the world in tty mode#10089

Closed
sillyDaibo wants to merge 4 commits intogoogle-gemini:mainfrom
sillyDaibo:main
Closed

fix(acp): --experimental-acp no longer stops the world in tty mode#10089
sillyDaibo wants to merge 4 commits intogoogle-gemini:mainfrom
sillyDaibo:main

Conversation

@sillyDaibo
Copy link
Copy Markdown

TLDR

When running gemini --experimental-acp in 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 -t to enable tty and --experimental-acp to enable acp mode, the problem also exists. Removing -t can 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

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

@sillyDaibo sillyDaibo requested a review from a team as a code owner September 28, 2025 04:46
@google-cla
Copy link
Copy Markdown

google-cla Bot commented Sep 28, 2025

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.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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 --experimental-acp flag in a TTY environment caused the gemini application to become unresponsive. The change ensures that the application correctly determines its interactive state when this experimental flag is active, thereby preventing the terminal from freezing and improving the user experience for developers debugging in TTY mode.

Highlights

  • Fix for --experimental-acp freezing in TTY: When gemini is run with the --experimental-acp flag in a TTY environment, the terminal would previously freeze completely. This pull request introduces a fix to prevent this behavior, ensuring the application remains responsive.
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.

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

Comment on lines 532 to +537
const interactive =
!!argv.promptInteractive ||
(process.stdin.isTTY && !hasPromptWords && !argv.prompt);
(process.stdin.isTTY &&
!hasPromptWords &&
!argv.prompt &&
!argv.experimentalAcp);
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

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);
});

@bdmorgan
Copy link
Copy Markdown
Collaborator

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!

@bdmorgan
Copy link
Copy Markdown
Collaborator

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.

@bdmorgan bdmorgan closed this Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/p1 Important and should be addressed in the near term.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants