Repository navigation
fix(core): settle queued tool calls on scheduler disposal - #29432
andreivince wants to merge 5 commits into
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. |
|
📊 PR Size: size/L
|
Summary of ChangesHello, 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 resource management issue where queued tool calls remained pending indefinitely after the scheduler was disposed. By clearing the request queue and implementing a disposal check during the scheduling phase, the system now ensures that all callers receive timely feedback and that no unauthorized work is processed post-disposal. 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 the 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 counterproductive. 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
|
There was a problem hiding this comment.
Code Review
This pull request enhances the Scheduler class by ensuring that queued requests are rejected and new batches are blocked when the scheduler is disposed, accompanied by comprehensive unit tests validating these cleanup behaviors. The feedback highlights an improvement opportunity: while the changes successfully prevent new batches from starting, they do not stop an active batch from executing its remaining queued tool calls if dispose() is called mid-batch. It is recommended to update _processNextItem to check the disposal signal and immediately terminate the active processing loop.
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
|
This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
Summary
Reject queued tool batches when their scheduler is disposed, cancel unstarted tools, and avoid requesting approval for work that can no longer run.
Details
Queued callers receive
Scheduler disposedand release their abort listeners. Remaining tools in the active batch are cancelled. Disposal is checked before execution and before entering a new confirmation flow after policy evaluation.If a running tool returns a sandbox error after disposal, preserve its error and output without requesting extra permissions for a retry. Running tools and confirmation flows already underway retain caller-controlled cancellation.
Related Issues
Fixes #29030
How to Validate
With Node.js 20.19.6, run
CI=true GEMINI_CLI_TRUST_WORKSPACE=true npm run preflight.The merged revision was revalidated on macOS; Linux checks cover the earlier revision. Windows, live model calls, and actual Docker, Podman, or Seatbelt CLI sandbox modes were not tested. MCP execution is not counted as validated: the existing replay test reported success despite a missing-tool error, reproduced without these changes. No user-facing commands, flags, or settings changed, so no documentation update is needed.
Pre-Merge Checklist