Repository navigation
fix(cli): restore approval focus after cancelling editor selection - #29798
seokjeongeum wants to merge 2 commits into
Conversation
|
📊 PR Size: size/L
|
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 addresses a user-reported regression in the CLI where pressing Escape during external editor selection would incorrectly cancel the tool approval request. The changes ensure that the editor selection dialog takes priority over stream cancellation, allowing users to safely exit the selection menu and return to the pending tool approval state without losing their progress. 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 the 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 counterproductive. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the ToolConfirmationQueue and EditorSettingsDialog components to handle focus states dynamically when dialogs are visible. Specifically, ToolConfirmationQueue now sets isFocused to !dialogsVisible using the dialogsVisible state from useUIState, and EditorSettingsDialog updates its keypress listener with priority: true. Additionally, a new test file ToolConfirmationQueue.editor.test.tsx has been introduced to verify tool confirmation behavior during external editor selection. There are no review comments, and I have no feedback to provide.
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |

Summary
Make Escape close external-editor selection and return to usable pending tool approval. The user can then Allow or Reject the edit without cancelling the request or changing the editor preference.
Details
Suspend the underlying approval controls while a dialog is visible, and prioritize the editor dialog's Escape handler over stream cancellation. Closing editor selection emits an undefined selection without persisting a preference. The scheduler returns to approval; cancelling the selector never executes the edit.
The integration regression includes a competing stream-style Escape handler and verifies both Allow and Reject, the build-file security warning, unchanged settings, and listener cleanup. No authentication, public settings-schema, model-catalog, or package-version changes.
Related Issues
User-reported regression; no linked issue.
How to Validate
Validated final head
67fc04dfc424c1f2bf760886a2cda9d75634992d, based on upstreamed96faedfd5571f055c44f2c9509d62321d1138d.node node_modules/vitest/vitest.mjs run --root packages/cli src/ui/components/ToolConfirmationQueue.editor.test.tsx src/ui/components/ToolConfirmationQueue.test.tsx src/ui/components/messages/ToolConfirmationMessage.test.tsx src/ui/components/EditorSettingsDialog.test.tsx src/ui/hooks/useEditorSettings.test.tsx --coverage.enabled=false --maxWorkers=1 --minWorkers=1: 77/77 pass on Linux Node 24.21.0 and native Windows Node 24.14.1. The competing-handler integration fails both cases before the dialog-priority correction and passes afterward.write_fileedit topackage.json, opens editor selection, sends one Escape, checks that the file is unchanged and the security warning/approval return, then separately verifies Allow changes the file and Reject leaves it unchanged. Both cases pass with CLI exit 0 on Linux and native Windows source launches, isolated actual packed-npx launches, and the built Linux Docker artifact. Fixture updates and update notifications are explicitly disabled.npm exec --offline --no-install --call, preserving the fixture project directory and preventing global binary shadowing. Native cold launches needed a 120-second fixture allowance; an extra captured-process wrapper was removed after a direct-launch comparison. Native PTY helpers retained handles after recording the CLI exit-0 assertion and were cleaned up separately; helper teardown is not reported as a successful product command.npm run build, affectednpm run typecheck,npm run bundle, changed-file ESLint/Prettier, andgit diff --checkpass. Native affected CLI build/typecheck and bundle generation pass. Locally packed artifacts are installed into isolated consumers before the npx feature probes.npm run preflightcompleted on this exact head in a disposable Linux checkout under Node 20.19.0 with two Vitest workers. Install/format/build/full lint/all typechecks pass and tracked source remains clean. CLI reports 10 failed, 7,401 passed, 4 skipped; core reports 76 failed, 8,296 passed, 57 skipped. All 86 failing records, including duplicate parameterized identities, reproduce on the matching upstream base with the same runtime, dependencies, isolated home, and worker bounds. There are no candidate-only failures. They concern mocked home/workspace paths, keychain mocks, and unavailablebwrap. Separately,npm run test:scriptspasses 202/202 andnpm run test:sea-launchpasses 17/17.GitHub Testing: CI for this head reports
action_required. A maintainer must approve the external-contributor workflow run; local results do not imply CI passed. Links and E2E runs have the same approval gate. macOS/Seatbelt are unavailable; Podman fixtures remain pending because host sudo authentication is unavailable.Pre-Merge Checklist