fix(cli): filter subagent sessions from resume history#19698
fix(cli): filter subagent sessions from resume history#19698abhipatel12 merged 2 commits intomainfrom
Conversation
Summary of ChangesHello @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 addresses an issue where internal subagent sessions were appearing in the user's resumable session list. It introduces a new 'kind' field to classify sessions as either 'main' or 'subagent', ensuring that only main conversations are displayed in the /resume command and session browser, thereby improving the user experience by keeping the session history clean and relevant. Highlights
Changelog
Activity
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
|
|
Size Change: +543 B (0%) Total Size: 25.2 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
The pull request successfully implements a mechanism to filter subagent sessions from the resume history in the CLI. By introducing a kind field to the ConversationRecord and ensuring it is persisted and checked during session retrieval, the user experience is improved by keeping the session list focused on main conversations. The changes are well-integrated across the core and cli packages, and the inclusion of unit tests ensures both the new functionality and backward compatibility for legacy sessions.
Mark recorded chat sessions as either 'main' or 'subagent' using a new 'kind' field in the session JSON. Updated LocalAgentExecutor to mark subagent sessions explicitly and enhanced the CLI's session discovery to skip them. Added tests to verify classification and filtering.
74042da to
9d144b7
Compare
9d144b7 to
315fda8
Compare
Summary
Prevent subagent session histories from being surfaced in the
/resumelist by marking them as subagent sessions and filtering them out during session retrieval. This ensures the session browser remains clean and only shows main conversations that users actually want to resume.Details
kindfield ('main' | 'subagent') to theConversationRecordinterface inpackages/core.ChatRecordingServiceto persist this field in the session JSON files.LocalAgentExecutorto mark its internalGeminiChatsessions as'subagent'.sessionUtils.tsto filter out any session marked as'subagent'.kindfield (legacy sessions) are treated as'main'.coreandclito verify classification and filtering logic.Related Issues
Related to the reported bug where internal subagent sessions were appearing in the resumable sessions list.
How to Validate
cli_helpby asking "how do I use hooks?")./resumecommand orgemini --list-sessions.npm test -w @google/gemini-cli-core -- src/services/chatRecordingService.test.tsnpm test -w @google/gemini-cli -- src/utils/sessionUtils.test.tsPre-Merge Checklist