fix(cli): avoid duplicate history and telemetry after confirmation - #29248
fix(cli): avoid duplicate history and telemetry after confirmation#29248PansaLegrand wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
📊 PR Size: size/M
|
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 issues with duplicate slash-command history entries and telemetry events that occur when a user confirms an action or shell command. By tracking command reinvocations, the logic now ensures that history and telemetry are only processed once, specifically upon the final outcome of the confirmed operation. This improves data consistency and provides a cleaner user experience during interactive command flows. 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 prevents duplicate history entries and terminal events from being recorded when a slash command requires confirmation (such as overwriting a checkpoint or executing shell commands). It introduces a commandReinvoked flag in useSlashCommandProcessor to track resumed invocations and avoid redundant logging. Unit tests have been added to verify this behavior, and the session management documentation has been updated to explain the checkpoint confirmation flow. I have no feedback to provide.
Summary
Fixes duplicate slash-command history and telemetry when an action is confirmed. For example, confirming an overwrite with
/resume save <tag>now keeps one command entry, even if another message arrived while the confirmation was open.Details
confirm_action.Draft for maintainer consideration: #29032 does not yet have the
help wanteddesignation. Could a maintainer confirm whether this focused fix is suitable for community contribution?Related Issues
Fixes #29032.
How to Validate
npm exec -w @google/gemini-cli -- vitest run src/ui/hooks/slashCommandProcessor.test.tsx --coverage.enabled=falsenpx --no-install eslint packages/cli/src/ui/hooks/slashCommandProcessor.ts packages/cli/src/ui/hooks/slashCommandProcessor.test.tsxnpm run preflighton macOS arm64 / Node.js 20.19.5:24cab6830a:src/gemini.test.tsxrequire the test environment used by.github/workflows/ci.yml. Rerunning startup and configuration tests withGEMINI_CLI_TRUST_WORKSPACE=truepassed 264 tests (two skipped).src/config/extensionRegistryClient.test.tsoccur because this host resolvesgeminicli.comto a reserved address, which the existing private-IP check rejects. No registry or network-safety code was changed.npm run test:scriptsandnpm run test:sea-launchThe regressions exercise an unrelated history update during confirmation, then assert a single command entry, one final telemetry event, and cleared confirmation state. They require no model request.
Pre-Merge Checklist