Repository navigation
fix(cli): protect current session from deletion - #29134
mikemikimike wants to merge 1 commit into
Conversation
|
📊 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 introduces safety improvements to the CLI session management to prevent data loss. By explicitly passing the active session ID to list and delete operations and refining how sessions are identified, the system now correctly distinguishes between the active session and other archived or similarly named files. 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 refactors the session selection logic to ensure that only the session file whose filename ends with the current session ID is marked as the current session, preventing false positives with archived session files. It updates listSessions to accept and propagate the currentSessionId parameter, and updates the corresponding tests. 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. |
|
I rechecked this PR for issue #29133. The PR is approved, the current checks are passing, and I do not see a code-specific failure or a human changes-requested review. Could a maintainer please review the completed change and merge it, or advise if any repository-side requirement remains? |
|
This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
Fixes #29133
Summary
--list-sessionsand--delete-sessionpaths.This prevents
--delete-sessionfrom deleting the live session and makes--list-sessionsdisplay the, currentmarker.Implementation
SessionSelector.listSessions()now accepts the active session ID and forwards it togetSessionFiles(). The filename check accepts both supported.jsonand.jsonlsession formats while requiring the exact suffix. Both CLI session commands passconfig.getSessionId()into the selector.Compatibility
No public command or file format changes. Sessions using either supported filename extension remain discoverable.
Testing
npm ci --ignore-scripts --no-audit --no-fund— passed.npm run test --workspace=@google/gemini-cli -- src/utils/sessionUtils.test.ts src/utils/sessions.test.ts— passed: 2 files, 45 tests.npm run typecheck --workspace=@google/gemini-cli— passed.npx prettier --experimental-cli --check packages/cli/src/utils/sessionUtils.ts packages/cli/src/utils/sessionUtils.test.ts packages/cli/src/utils/sessions.ts packages/cli/src/utils/sessions.test.ts— passed (Prettier reported the option as ignored by the installed CLI).npx eslint packages/cli/src/utils/sessionUtils.ts packages/cli/src/utils/sessionUtils.test.ts packages/cli/src/utils/sessions.ts packages/cli/src/utils/sessions.test.ts— passed.npm run test:ci— attempted after dependency installation; the initial run failed before the relevant tests because the source archive lacked built workspace package outputs. After building the core package, the second run passed the a2a-server suite but did not produce a reliable final aggregate result in the archive-based environment. The focused affected tests above are the definitive local regression result.Limitations
The repository was obtained from the GitHub source archive because Git HTTPS fetches stalled in this environment. The archive extractor reported errors for a small set of long snapshot paths unrelated to this change. The checked source paths and all affected tests were present and verified.