fix(cli): preserve legacy auto memory behavior#25625
fix(cli): preserve legacy auto memory behavior#25625jasonmatthewsuhari wants to merge 3 commits intogoogle-gemini:mainfrom
Conversation
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 a regression introduced by a recent flag split in the CLI configuration. It restores the expected behavior for legacy users who relied on the memory manager to implicitly enable auto-memory features, while maintaining the ability for users to explicitly opt-out of these features. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements backward compatibility for the autoMemory configuration flag by falling back to the memoryManager setting when autoMemory is not explicitly defined. While the logic and tests are added, the reviewer noted a potential issue: if the configuration schema defines a default value for autoMemory, the nullish coalescing operator will not trigger the fallback. The current tests use a delete operation to simulate an undefined state, which suggests that the schema or the implementation should be refined to ensure the legacy behavior is correctly restored without workarounds.
|
Addressed the Gemini Code Assist findings in two follow-up commits. The compatibility fix now happens during settings merge, where we can still distinguish an explicit experimental.autoMemory setting from a schema defaulted value, and the regression coverage now goes through loadSettings() instead of deleting a field from a synthetic merged object. Verified with |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces backward compatibility for memory management settings. It adds a hasOwnNestedProperty helper to detect if experimental.autoMemory has been explicitly configured in any settings source. In the mergeSettings function, if autoMemory is not explicitly set but the legacy memoryManager is enabled, autoMemory is now automatically enabled. Unit tests have been added to ensure this logic works correctly and that explicit overrides are respected. I have no feedback to provide.
Fixes #25623
Summary
Restore backward-compatible Auto Memory behavior for existing users who only have
experimental.memoryManager = truein settings.What changed
experimentalAutoMemoryinherits fromexperimental.memoryManageronly whenexperimental.autoMemoryis not explicitly set.experimental.autoMemory = false.Why
After the flag split, existing users could still have the memory manager enabled but lose
/memory inboxaccess and background Auto Memory startup unless they manually added the new flag. This restores the old behavior for legacy configs without collapsing the new flag split.Testing
node scripts/generate-git-commit-info.jsC:\Users\Jason\Documents\GitHub\gemini-cli\node_modules\.bin\vitest.cmd run src/config/config.test.ts --coverage.enabled=falseC:\Users\Jason\Documents\GitHub\gemini-cli\node_modules\.bin\vitest.cmd run src/ui/commands/memoryCommand.test.ts --coverage.enabled=false