feat(core): implement model-driven parallel tool scheduler#21933
feat(core): implement model-driven parallel tool scheduler#21933abhipatel12 merged 3 commits intomainfrom
Conversation
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 significantly enhances the tool scheduling mechanism by shifting concurrency control from hardcoded tool categories to explicit model intent. By introducing a Highlights
Changelog
Activity
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
|
|
Size Change: +2.1 kB (+0.01%) Total Size: 26.6 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request implements a model-driven parallel tool scheduler by introducing a wait_for_previous parameter, which is a solid architectural improvement for concurrency control. However, it introduces a significant security risk by defaulting to parallel execution for all tools, including those that modify the system state, shifting the responsibility for preventing race conditions to the LLM. It is recommended to default to sequential execution for state-changing tools to ensure a 'secure by default' posture. Additionally, an issue was identified in the addWaitForPreviousParameter implementation that could fail to add the new parameter in some edge cases.
324be21 to
0e8c512
Compare
Introduce the 'wait_for_previous' parameter to all tool schemas, shifting concurrency control from hardcoded tool categories (Kinds) to explicit model intent. The scheduler now batches tools into parallel waves by default, unless the model flags a tool to act as a sequential barrier.
0e8c512 to
feb0956
Compare
Summary
This PR implements a robust, model-driven parallel tool scheduler by introducing a
wait_for_previousparameter to all tool schemas. It shifts concurrency control from hardcoded tool categories (Kinds) to explicit model intent, allowing tools to batch into parallel waves by default unless the model flags a tool to act as a sequential barrier.Details
_isParallelizablemethod inSchedulernow checksrequest.args?.wait_for_previous. If omitted or false, tools execute concurrently.DeclarativeToolnow universally injects thewait_for_previousparameter into tool schemas (viaaddWaitForPreviousParameter).scheduler.test.tshave been updated/added to ensure the new batching logic handles both parallel waves and sequential barriers correctly.Related Issues
How to Validate
npm startPre-Merge Checklist