Skip to content

fix(config):Reviving CustomWitty feature - #8432

Merged
richieforeman merged 10 commits into
google-gemini:mainfrom
JayadityaGit:redemptionOfCustomWittyFix
Sep 22, 2025
Merged

richieforeman merged 10 commits into
google-gemini:mainfrom
JayadityaGit:redemptionOfCustomWittyFix

Conversation

@JayadityaGit

Copy link
Copy Markdown
Contributor

TLDR

This PR is a redemption PR for #7782.
In my earlier attempt, I forgot to sync the latest changes into my branch before making edits. That led to merge conflicts and complex issues, so I’ve created a fresh branch and brought the corrected changes here.

The core change:

  • Fixes the ui object overwrite bug by teaching the app to merge objects instead of replacing them blindly.

  • Arrays are still replaced as expected (so user lists like customWittyPhrases behave correctly).


Dive Deeper

Previously, when a user updated their settings, the app overwrote the entire ui object in memory. For example:

  • Adding a new theme would erase any customWittyPhrases.

This PR introduces logic that checks:

  1. If both old and new values are plain objects → merge them.

  2. If either value is an array → replace them.

This ensures:

  • Updating themes preserves custom phrases.

  • Updating arrays (like phrases) correctly replaces old values.

This makes settings updates safer, smarter, and more intuitive for users.


Testing Matrix

  🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

@JayadityaGit
JayadityaGit requested a review from a team as a code owner September 14, 2025 07:56

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @JayadityaGit, 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 a crucial improvement to how user settings are updated and migrated, specifically addressing an issue where parts of the 'ui' object were being overwritten instead of merged. By implementing a smart merging strategy for objects and maintaining replacement behavior for arrays, the system now handles settings updates more robustly, ensuring user configurations like custom witty phrases are preserved while allowing other settings to be updated safely. This makes the settings management more intuitive and prevents data loss.

Highlights

  • Redemption PR: This pull request is a redemption for a previous attempt (#7782) to fix a settings bug, addressing issues that arose from an unsynced branch.
  • Smart Object Merging: Implements logic to merge properties of the 'ui' object when updating settings, preventing accidental overwrites of existing configurations like 'customWittyPhrases'.
  • Array Replacement: Ensures that array-type settings (e.g., 'customWittyPhrases') are still replaced entirely when updated, maintaining expected behavior for lists.
  • Improved Settings Migration: Enhances the 'migrateSettingsToV2' function to intelligently merge objects and replace arrays during settings migration, making updates safer and more intuitive.
Using Gemini Code Assist

The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@JayadityaGit JayadityaGit changed the title Redemption of custom witty fix fix(config):Redemption of custom witty fix Sep 14, 2025

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a bug where parts of the ui settings object were being overwritten during settings migration. The fix introduces a deep merge for objects when migrating settings from v1 to v2 format, ensuring that existing nested settings are preserved. The changes are well-contained within the migration logic and are accompanied by a new test case that verifies the fix for customWittyPhrases. The implementation correctly handles the merging of objects while continuing to replace arrays, as intended. Overall, the changes look solid and effectively resolve the described issue.

@JayadityaGit

Copy link
Copy Markdown
Contributor Author

@richieforeman, please take a look when you get a chance — I’m happy to refine further if needed

@gemini-cli gemini-cli Bot added kind/bug priority/p2 Important but can be addressed in a future release. area/core Issues related to User Interface, OS Support, Core Functionality labels Sep 14, 2025
@richieforeman
richieforeman self-requested a review September 16, 2025 21:56

@richieforeman richieforeman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@JayadityaGit

Copy link
Copy Markdown
Contributor Author

All preflight checks are passing locally. I'm not sure why one of the windows test is failing.

@JayadityaGit

Copy link
Copy Markdown
Contributor Author

This PR has already been reviewed and approved. Could we please get it merged when convenient? It restores the customWittyFeature, which is currently not working.

Thanks!

@JayadityaGit JayadityaGit changed the title fix(config):Redemption of custom witty fix fix(config):Reviving CustomWitty feature Sep 21, 2025
@richieforeman
richieforeman added this pull request to the merge queue Sep 22, 2025
Merged via the queue into google-gemini:main with commit 92543da Sep 22, 2025
18 checks passed
yashv6655 added a commit to yashv6655/gemini-cli that referenced this pull request Sep 22, 2025
Co-authored-by: Richie Foreman <richie.foreman@gmail.com>
Co-authored-by: Arya Gummadi <aryagummadi@google.com>
giraffe-tree pushed a commit to giraffe-tree/gemini-cli that referenced this pull request Oct 10, 2025
Co-authored-by: Richie Foreman <richie.foreman@gmail.com>
Co-authored-by: Arya Gummadi <aryagummadi@google.com>
cocosheng-g pushed a commit that referenced this pull request May 6, 2026
Co-authored-by: Richie Foreman <richie.foreman@gmail.com>
Co-authored-by: Arya Gummadi <aryagummadi@google.com>
@sripasg sripasg added the size/m A medium sized PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality priority/p2 Important but can be addressed in a future release. size/m A medium sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants