feat(cli): implement event-driven tool execution scheduler#17078
Conversation
Summary of ChangesHello @abhipatel12, 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 introduces a new event-driven tool execution scheduler, marking a significant step in migrating the CLI's execution engine. By implementing a facade hook, the system can seamlessly toggle between the existing legacy scheduler and the new, more modern event-driven approach. This change enhances the underlying architecture by utilizing a 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 pull request introduces a well-architected, event-driven tool execution scheduler. The use of a facade hook (useToolScheduler) to toggle between the legacy and new schedulers is an excellent approach for this migration. The adapter pattern in useToolExecutionScheduler is cleanly implemented to maintain compatibility with existing UI components by injecting onConfirm callbacks. The new code is accompanied by comprehensive tests, ensuring the new scheduler and the facade logic are robust. Overall, this is a high-quality contribution that modernizes the tool execution flow while ensuring a seamless transition.
261ce23 to
7aa0506
Compare
|
Size Change: +35.4 kB (+0.15%) Total Size: 23.2 MB
ℹ️ View Unchanged
|
7aa0506 to
170a7f4
Compare
…imental gate - Introduces useToolScheduler facade to conditionally toggle between legacy and event-driven schedulers. - Implements useToolExecutionScheduler using the new event-driven Core Scheduler (Bridge Phase). - Provides robust Adapter for legacy confirmation callbacks, supporting Inline Edit payloads. - Ensures functional parity with legacy response submission tracking and session timing. - Includes comprehensive unit tests for the new hook and the facade. - Verified with full workspace build, lint, and typecheck.
170a7f4 to
ab1798c
Compare
…l execution scheduler (google-gemini#17078)
Summary
Implement the event-driven tool execution scheduler and integrate it into the
CLI UI via a facade hook. This completes the "Bridge" phase of the ReAct loop
migration, allowing for seamless toggling between legacy and modern execution
engines.
Details
useToolExecutionScheduler.ts, whichutilizes the new Core
SchedulerandMessageBus.MessageBus-proxyingonConfirmcallbacks into Core objects, maintainingcompatibility with legacy UI components.
useToolScheduler.tsto act as a single entry pointfor
useGeminiStream, switching implementations based on the experimentalflag.
across both implementations.
useToolExecutionScheduler.test.ts(400+ lines of coverage).useToolSchedulerFacade.test.tsto verify conditional delegation.useGeminiStream.test.tsxto reflect the new facade integration.Related Issues
Related to #14306
How to Validate
npm test -w @google/gemini-cli -- src/ui/hooks/useToolExecutionScheduler.test.tsnpm test -w @google/gemini-cli -- src/ui/hooks/useToolSchedulerFacade.test.tsnpm test -w @google/gemini-cli -- src/ui/hooks/useGeminiStream.test.tsx"enableEventDrivenScheduler": truein settings.jsonreplaceorwrite_file) and verify:Pre-Merge Checklist