refactor(cli): finalize event-driven transition and remove interaction bridge - #18569
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 marks the final stage of the tool scheduler cleanup in the CLI, moving away from a hybrid approach to a pure event-driven model for handling tool confirmations. The core impact is a more consistent and maintainable architecture for tool interactions, where all approvals and cancellations are now mediated through a central MessageBus, removing direct callback dependencies and simplifying the UI's interaction with the underlying 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 an excellent refactoring that finalizes the transition to a fully event-driven architecture for tool confirmations by removing the legacy onConfirm callback mechanism. The changes are thorough, consistently applied across components, hooks, types, and tests, and significantly improve code clarity and maintainability. The removal of the interaction bridge in useToolScheduler and the simplification of ToolActionsContext are particularly noteworthy improvements. The test suite has been updated comprehensively to reflect these changes, ensuring the new event-driven flow is well-covered. Overall, this is a high-quality contribution that strengthens the foundation of the CLI's tool handling logic.
cd89ffd to
f63186e
Compare
2f0c8a5 to
dab0b35
Compare
f63186e to
77d4c65
Compare
dab0b35 to
6fa69ec
Compare
|
Size Change: -704 B (0%) Total Size: 24.4 MB ℹ️ View Unchanged
|
6fa69ec to
a73bf00
Compare

Summary
This final phase of the tool scheduler cleanup removes the "interaction bridge" between the modern event-driven engine and legacy UI expectations. It eliminates all manual
onConfirmcallback injections, ensuring that the CLI interacts with tool approvals exclusively via theMessageBus.Details
useToolScheduler.ts: Removed the legacy adapter that was injectingonConfirmcallbacks into tool call objects.ToolActionsContext.tsx: Removed the legacy callback-based confirmation path. All tool confirmations are now dispatched purely via theMessageBususingcorrelationId.useGeminiStream.ts: Refactored auto-approval logic (e.g., for YOLO mode orask_usertools) to publish directly to theMessageBus.IndividualToolCallDisplayand associated event types to useSerializableConfirmationDetailsexclusively, removing references to the callback-basedToolCallConfirmationDetails.onConfirmstubs and refactoreduseGeminiStream.test.tsxto verify correctMessageBusinteractions.Related Issues
Final stage of the legacy scheduler cleanup in the CLI package.
How to Validate
npm run preflightto ensure all tests pass and the build is stable.Pre-Merge Checklist