feat(sessions): add resuming to geminiChat and add CLI flags for session management#10719
Conversation
Summary of ChangesHello @bl-ue, 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, the fourth in a series, significantly enhances session management for the Gemini CLI. It primarily focuses on enabling session resumption in non-interactive mode and providing comprehensive command-line tools for listing and deleting chat sessions. Key changes include adding new CLI arguments for session control, integrating session loading and history conversion into the non-interactive chat flow, and introducing new utility functions and a 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 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 is a great step forward in improving session management. The new CLI flags for listing, deleting, and resuming sessions are valuable additions. The implementation is solid, especially the logic in SessionSelector for resolving session identifiers.
I've found one high-severity issue related to parsing session identifiers for deletion that could lead to deleting the wrong session. Please see the detailed comment below.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This is a great step forward in implementing session management. The new CLI flags for listing, resuming, and deleting sessions are well-implemented, and the underlying logic for session resolution and history conversion is comprehensive. I have one high-severity suggestion regarding code duplication that will improve the long-term maintainability of this new functionality. Overall, excellent work on this complex feature.
|
I tried to resume a session, but the previous content of the session wasn't displayed. Is that a bug? |
1a20cfb to
0c9d470
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a significant feature: session management for the CLI. It adds the ability to list, delete, and resume previous chat sessions through new command-line flags (--list-sessions, --delete-session, and --resume). The implementation is well-structured, with logic for session discovery, selection, and data conversion neatly encapsulated in new utility files and React hooks. The changes span both interactive and non-interactive modes, ensuring a consistent experience. The addition of comprehensive unit tests for the new functionality, including argument parsing, session data conversion, and the new UI hooks, is commendable and ensures the feature is robust. Overall, this is a solid contribution that greatly enhances the usability of the CLI. I found no critical or high-severity issues in the implementation.
|
Hi @mrcabbage972, thank you for approving the tests. I fixed the failing ones—they were caused by changes from my merges of main over time. |
|
Next: #13300 |
…ion management (#10719) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
@bl-ue this has a small bug, where when you try to resume a session noninteractively with stdin, it doesn't accept it and gives you this error: When resuming a session, you must provide a message via --prompt (-p) or stdin the check on line 262 ( if (argv.resume && !argv.prompt && !process.stdin.isTTY) ) isn't quite right |
…resume Reported by @arjun810 in google-gemini#10719 (comment). Thank you @arjun810!
…ion management (google-gemini#10719) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This PR implements session resuming in
geminiChat.ts, session selection, listing, and deletion functions, and CLI flags--list-sessions,--delete-session <id|index>, and--resume <id|index>.Closes #1530
Note: This PR is the 4th in a series of PRs that implement automatic chat recording and resuming in both interactive and non-interactive modes, with command line flags for non-interactive resuming and session management, and an interactive session browser.
PR #4401 was the original monolithic PR, which implemented this feature from the ground up. It's too large to merge as-is, however, and so it was broken up into several smaller PRs, of which this PR is the 4th.
Please see #4401's description for the full context of this PR. The original monolithic PR's description contains a detailed analysis of the entire system, with an example of the recording JSON and a demo video.