refactor(cli): switch useToolScheduler to event-driven engine#18565
refactor(cli): switch useToolScheduler to event-driven engine#18565abhipatel12 merged 1 commit intomainfrom
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 streamlines the tool scheduling mechanism within the CLI by fully adopting the event-driven architecture. The change removes conditional logic and legacy code paths, resulting in a more robust and maintainable system for handling tool execution. This is a significant step in cleaning up the codebase and ensuring all tool interactions leverage the modern event-driven engine. 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
|
There was a problem hiding this comment.
Code Review
This pull request is a solid refactoring that successfully migrates the useToolScheduler hook to exclusively use the event-driven engine. By removing the legacy scheduler path and the associated isEventDrivenSchedulerEnabled feature flag, the code is now simpler and more maintainable. The related cleanups in useGeminiStream, mock configurations, and the deletion of the obsolete test file are all appropriate. I have one minor suggestion to further tighten up a type definition that is now outdated as a result of this refactor.
|
Size Change: -4.09 kB (-0.02%) Total Size: 23.8 MB
ℹ️ View Unchanged
|
Summary
This PR migrates the
useToolSchedulerhook in the CLI package to use the event-driven tool execution engine exclusively. It removes the branching logic that previously supported the legacy scheduler, simplifying the core logic for tool scheduling and stream processing.Details
packages/cli/src/ui/hooks/useToolScheduler.tsto directly wrapuseToolExecutionScheduler.packages/cli/src/ui/hooks/useGeminiStream.tsby removing theisEventDrivencheck inpendingToolGroupItems, assuming event-driven behavior.packages/cli/src/test-utils/mockConfig.tsto remove theisEventDrivenSchedulerEnabledflag.packages/cli/src/ui/hooks/useToolSchedulerFacade.test.tsas the facade logic no longer exists.Related Issues
Part of a larger effort to clean up the legacy scheduler from the CLI package.
How to Validate
npm run preflightto ensure all tests, linting, and typechecks pass.Pre-Merge Checklist