Fix: Avoid tool confirmation timeout when no UI listeners are present#17955
Conversation
|
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 @pdHaku0, 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 a critical issue where tool execution could hang indefinitely in headless or non-interactive environments when a user confirmation was required but no UI listener was available to provide it. The change ensures that in such scenarios, the system fails fast by automatically denying the confirmation, thereby preventing timeouts and improving system responsiveness. 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
The pull request effectively addresses the issue of tool execution hanging in headless or non-interactive environments by introducing a check for UI listeners before requesting user confirmation. If no listeners are present, it immediately responds with a TOOL_CONFIRMATION_RESPONSE indicating that confirmation was needed but could not be obtained. This is a robust solution that improves responsiveness and prevents indefinite waits, aligning well with the described problem and solution. The code is clear and the logic is sound.
2726449 to
26306d6
Compare
5d23595
Summary
Fixes an issue where tool execution hangs waiting for user confirmation in environments without an attached UI listener (e.g., initial ACP connection or headless mode).
Details
In
packages/core/src/confirmation-bus/message-bus.ts, theASK_USERpolicy decision logic has been updated.It now checks if there are any active listeners for
TOOL_CONFIRMATION_REQUEST.TOOL_CONFIRMATION_RESPONSEwithconfirmed: false.This prevents the system from waiting indefinitely (or until a long timeout) for a user confirmation that effectively cannot be given, improving responsiveness in automated or headless scenarios.
Related Issues
Fixes #17952
How to Validate
Pre-Merge Checklist