fix(core): preserve dynamic tool descriptions on session resume#18835
fix(core): preserve dynamic tool descriptions on session resume#18835
Conversation
|
Hi @sehoon38, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
Summary of ChangesHello @sehoon38, 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 regression where specific, dynamic descriptions of tool calls were lost when a chat session was resumed. The changes ensure that these detailed descriptions, which provide context like specific filenames or search queries, are correctly captured and retained across sessions, improving the user experience by maintaining conversational fidelity. 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: +120 B (0%) Total Size: 26.5 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request correctly addresses a regression where dynamic tool descriptions were lost on session resume. The changes ensure that the dynamic description from a tool invocation is captured and prioritized during chat recording. However, I've identified a potential critical issue that could lead to a runtime error due to an unsafe property check, and a high-severity issue regarding the handling of optional string fallbacks that deviates from repository guidelines. Please see my detailed comments for suggestions to improve the robustness of this fix.
342ec20 to
b07e153
Compare
b07e153 to
e4fa648
Compare
b6fc993 to
c14fc34
Compare
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
c14fc34 to
d22efb2
Compare
…le-gemini#18835) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…le-gemini#18835) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…le-gemini#18835) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

Summary
Fixes a bug where dynamic tool descriptions (e.g., specific filenames or search queries) were lost and replaced by generic tool descriptions when resuming a session.
Details
Since the initial implementation of session recording (PR #6721),
ChatRecordingService.recordToolCallshas been unconditionally overwriting incoming tool descriptions with generic ones from theToolRegistry. Furthermore,GeminiChat.recordCompletedToolCallswas not extracting or providing the dynamic description from the tool invocation.This PR:
ChatRecordingService.recordToolCallsto prioritize and preserve existing descriptions if provided.GeminiChat.recordCompletedToolCallsto extract the dynamic description usinginvocation.getDescription()(with a safe truthiness check) and pass it to the recording service.Related Issues
Fixes #18842
How to Validate
geminiRead GEMINI.mdgemini --resume latest