Skip to content

refactor(cli): simplify UI and remove legacy inline tool confirmation logic - #18566

Merged
abhipatel12 merged 2 commits into
mainfrom
abhi/event-tools-cleanup.3
Feb 12, 2026
Merged

refactor(cli): simplify UI and remove legacy inline tool confirmation logic#18566
abhipatel12 merged 2 commits into
mainfrom
abhi/event-tools-cleanup.3

Conversation

@abhipatel12

Copy link
Copy Markdown
Contributor

Summary

This PR simplifies the CLI's UI components by removing legacy inline tool confirmation logic. Since the event-driven scheduler now handles all tool confirmations in a global queue at the bottom of the terminal, the inline interactive elements and associated branching logic in the conversation history are no longer needed.

Details

  • ToolGroupMessage.tsx: Removed the isEventDriven flag. It now always hides Pending and Confirming tools from the history log.
  • ToolGroupMessage.tsx: Removed the inline ToolConfirmationMessage rendering and associated "dimming" logic for tools awaiting approval.
  • MainContent.tsx & AlternateBufferQuittingDisplay.tsx: Simplified the logic to always show the Global Confirmation Queue when a tool is awaiting approval, removing redundant configuration checks.
  • Tests: Refactored ToolGroupMessage.test.tsx to assume the event-driven behavior as the default and deleted ToolConfirmationMessageOverflow.test.tsx as the inline overflow path is obsolete.

Related Issues

Part 2 of the legacy scheduler cleanup in the CLI package.

How to Validate

  1. Run npm run test -w @google/gemini-cli to ensure all simplified UI tests pass.
  2. Trigger a tool call requiring confirmation and verify that the confirmation prompt appears correctly in the Global Queue and NOT inline within the message history.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run

@abhipatel12
abhipatel12 requested a review from a team as a code owner February 8, 2026 05:18
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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 CLI's user interface by deprecating and removing outdated inline tool confirmation mechanisms. By fully embracing the event-driven scheduler, all tool confirmations are now consistently managed through a global queue, leading to a cleaner and more predictable user experience. The changes simplify the underlying codebase by removing conditional logic and legacy components that are no longer necessary.

Highlights

  • UI Simplification: Removed legacy inline tool confirmation logic and UI components from the CLI, standardizing all tool confirmations to be handled by the global queue at the bottom of the terminal.
  • Codebase Cleanup: Eliminated the isEventDriven flag and associated conditional logic across various UI components, as the event-driven scheduler is now the default and sole mechanism for tool confirmations.
  • Test Refactoring: Updated ToolGroupMessage.test.tsx to reflect the new default behavior of hiding pending and confirming tools from the history log, and deleted the obsolete ToolConfirmationMessageOverflow.test.tsx.
  • Scheduler Unification: The useToolScheduler hook now exclusively uses the useToolExecutionScheduler, removing the facade logic that previously switched between legacy and event-driven schedulers.
Changelog
  • packages/cli/src/test-utils/mockConfig.ts
    • Removed isEventDrivenSchedulerEnabled from mock configuration, reflecting its deprecation.
  • packages/cli/src/ui/components/AlternateBufferQuittingDisplay.tsx
    • Removed useConfig import and isEventDrivenSchedulerEnabled check.
    • Simplified showPromptedTool logic to directly depend on confirmingTool presence.
  • packages/cli/src/ui/components/MainContent.tsx
    • Removed useConfig import and isEventDrivenSchedulerEnabled check.
    • Simplified showConfirmationQueue logic to directly depend on confirmingTool presence.
  • packages/cli/src/ui/components/messages/ToolConfirmationMessageOverflow.test.tsx
    • Deleted obsolete test file for inline tool confirmation overflow.
  • packages/cli/src/ui/components/messages/ToolGroupMessage.test.tsx
    • Removed createMockSettings import and enableEventDrivenScheduler from mock config.
    • Updated tests to assert that Confirming and Pending tools are now hidden by default in ToolGroupMessage.
    • Removed test cases related to legacy inline confirmation handling and conditional event-driven scheduler behavior.
  • packages/cli/src/ui/components/messages/ToolGroupMessage.tsx
    • Removed ToolConfirmationMessage and useConfig imports.
    • Removed isFocused prop from component definition.
    • Removed isEventDriven flag and conditional logic; visibleToolCalls now always filters out Pending and Confirming tools.
    • Removed toolAwaitingApproval memoization and related emphasis logic, setting emphasis to 'medium' by default.
    • Removed inline rendering of ToolConfirmationMessage.
  • packages/cli/src/ui/components/messages/snapshots/ToolGroupMessage.test.tsx.snap
    • Updated snapshots to reflect the new UI behavior where confirming and pending tools are hidden from the history log.
  • packages/cli/src/ui/hooks/useGeminiStream.ts
    • Removed isEventDriven flag and conditional logic, assuming event-driven behavior for tool visibility.
  • packages/cli/src/ui/hooks/useToolScheduler.ts
    • Removed imports for useReactToolScheduler and LegacyTrackedToolCall.
    • Removed the TrackedToolCall union type.
    • Modified useToolScheduler to directly call useToolExecutionScheduler, eliminating the conditional facade.
  • packages/cli/src/ui/hooks/useToolSchedulerFacade.test.ts
    • Deleted obsolete test file for the useToolScheduler facade.
Activity
  • The pull request author, abhipatel12, created this PR to simplify the CLI's UI by removing legacy inline tool confirmation logic.
  • The author provided a detailed summary, specific changes, related issues, validation steps, and a pre-merge checklist in the PR description.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions

github-actions Bot commented Feb 8, 2026

Copy link
Copy Markdown

Size Change: -1.59 kB (-0.01%)

Total Size: 24.3 MB

Filename Size Change
./bundle/gemini.js 24.3 MB -1.59 kB (-0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB

compressed-size-action

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a solid refactoring that simplifies the UI by removing the legacy inline tool confirmation logic and standardizing on the event-driven scheduler with a global confirmation queue. The changes are consistent across components, hooks, and tests, leading to a cleaner and more maintainable codebase. I've identified one area for improvement to fully complete the legacy code removal, which involves cleaning up a now-unused file and its associated type definitions.

Comment thread packages/cli/src/ui/hooks/useToolScheduler.ts
@gemini-cli gemini-cli Bot added the status/need-issue Pull requests that need to have an associated issue. label Feb 8, 2026
@abhipatel12
abhipatel12 changed the base branch from main to abhi/event-tools-cleanup.2 February 8, 2026 05:43
Base automatically changed from abhi/event-tools-cleanup.2 to main February 8, 2026 20:37
@abhipatel12
abhipatel12 force-pushed the abhi/event-tools-cleanup.3 branch 2 times, most recently from 13703d1 to f9fff2e Compare February 8, 2026 22:57

@jacob314 jacob314 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm
So much deleted code!

@jacob314

jacob314 commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Great cleanup! Removing the legacy inline confirmation logic significantly simplifies the UI state and aligns perfectly with the event-driven scheduler.

A few minor points for consistency and further cleanup:

  1. Redundant Comments: In packages/cli/src/ui/components/messages/ToolGroupMessage.tsx, there are still comments referring to "If Event-Driven Scheduler is enabled" (lines 63-64, 110-111). Since this is now the standard behavior, these comments should be updated to reflect the current architecture without referencing the old flag.
  2. Redundant Test Case: In packages/cli/src/ui/components/messages/ToolGroupMessage.test.tsx, the test case "renders when not focused" (lines 202-214) is now identical to "renders single successful tool call" because the isFocused prop was removed. This test can be deleted.
  3. Snapshot Redundancy: In the same test file, the test "hides confirming tools (standard behavior)" uses expect(lastFrame()).toBe('') followed by toMatchSnapshot(). Since you're already asserting the frame is empty, the empty snapshot is redundant.
  4. Ask User filtering: In ToolGroupMessage.tsx, the isAskUserInProgress helper is used to filter out AskUser tools. Since ToolGroupMessage now also filters out all Pending and Confirming tools generally, verify if there's any remaining case where isAskUserInProgress provides unique filtering (e.g., for Executing status). It looks correct, but worth a quick double-check.

Overall, the code quality is high and the logic is much cleaner.

@abhipatel12
abhipatel12 force-pushed the abhi/event-tools-cleanup.3 branch from f9fff2e to b614153 Compare February 12, 2026 00:35
@abhipatel12
abhipatel12 added this pull request to the merge queue Feb 12, 2026
Merged via the queue into main with commit c370d23 Feb 12, 2026
27 checks passed
@abhipatel12
abhipatel12 deleted the abhi/event-tools-cleanup.3 branch February 12, 2026 01:00
krsjenmt added a commit to krsjenmt/gemini-cli that referenced this pull request Feb 12, 2026
…ini/gemini-cli (#37)

* fix(cli): resolve double rendering in shpool and address vscode lint warnings (google-gemini#18704)

* feat(plan): document and validate Plan Mode policy overrides (google-gemini#18825)

* Fix pressing any key to exit select mode. (google-gemini#18421)

* fix(cli): update F12 behavior to only open drawer if browser fails (google-gemini#18829)

* feat(plan): allow skills to be enabled in plan mode (google-gemini#18817)

Co-authored-by: Jerop Kipruto <jerop@google.com>

* docs(plan): add documentation for plan mode tools (google-gemini#18827)

* Remove experimental note in extension settings docs (google-gemini#18822)

* Update prompt and grep tool definition to limit context size (google-gemini#18780)

* docs(plan): add `ask_user` tool documentation (google-gemini#18830)

* Revert unintended credentials exposure (google-gemini#18840)

* feat(core): update internal utility models to Gemini 3 (google-gemini#18773)

* feat(a2a): add value-resolver for auth credential resolution (google-gemini#18653)

* Removed getPlainTextLength (google-gemini#18848)

* More grep prompt tweaks (google-gemini#18846)

* refactor(cli): Reactive useSettingsStore hook (google-gemini#14915)

* fix(mcp): Ensure that stdio MCP server execution has the `GEMINI_CLI=1` env variable populated. (google-gemini#18832)

* fix(core): improve headless mode detection for flags and query args (google-gemini#18855)

* refactor(cli): simplify UI and remove legacy inline tool confirmation logic (google-gemini#18566)

* feat(cli): deprecate --allowed-tools and excludeTools in favor of policy engine (google-gemini#18508)

* fix(workflows): improve maintainer detection for automated PR actions (google-gemini#18869)

* refactor(cli): consolidate useToolScheduler and delete legacy implementation (google-gemini#18567)

* Update changelog for v0.28.0 and v0.29.0-preview0 (google-gemini#18819)

* fix(core): ensure sub-agents are registered regardless of tools.allowed (google-gemini#18870)

---------

Co-authored-by: Brad Dux <959674+braddux@users.noreply.github.com>
Co-authored-by: Jerop Kipruto <jerop@google.com>
Co-authored-by: Jacob Richman <jacob314@gmail.com>
Co-authored-by: Sandy Tao <sandytao520@icloud.com>
Co-authored-by: Adib234 <30782825+Adib234@users.noreply.github.com>
Co-authored-by: christine betts <chrstn@uw.edu>
Co-authored-by: Christian Gunderman <gundermanc@gmail.com>
Co-authored-by: Adam Weidman <65992621+adamfweidman@users.noreply.github.com>
Co-authored-by: Dev Randalpura <devrandalpura@google.com>
Co-authored-by: Pyush Sinha <pyushsinha20@gmail.com>
Co-authored-by: Richie Foreman <richie.foreman@gmail.com>
Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com>
Co-authored-by: Abhi <43648792+abhipatel12@users.noreply.github.com>
Co-authored-by: Abhijit Balaji <abhijitbalaji@google.com>
Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
Co-authored-by: g-samroberts <158088236+g-samroberts@users.noreply.github.com>
Co-authored-by: matt korwel <matt.korwel@gmail.com>
kuishou68 pushed a commit to iOfficeAI/gemini-cli-pro that referenced this pull request Feb 27, 2026
liamhelmer pushed a commit to badal-io/gemini-cli that referenced this pull request Mar 12, 2026
@sripasg sripasg added the size/l A large sized PR label Jun 2, 2026
software-0ficial pushed a commit to software-0ficial/gemini-cli that referenced this pull request Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l A large sized PR status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants