fix(cli): add missing response key to custom theme text schema#25822
Conversation
The `text.response` color override is documented at https://geminicli.com/docs/cli/themes/#changing-themes and is implemented in the runtime theme system (packages/cli/src/ui/themes/theme.ts and semantic-tokens.ts), but it was missing from the CustomTheme validation schema. This caused the settings validator to reject any custom theme using the `response` key with an "Unrecognized key(s)" error on every CLI invocation, even though the value was actually applied correctly at render time. Adds `response` to the `text` properties of the CustomTheme definition, regenerates schemas/settings.schema.json, and adds a regression test. Fixes google-gemini#25610
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 resolves a validation error occurring in the CLI when users define custom themes with a 'text.response' color override. By updating the configuration schema to include this property, the validation logic now correctly recognizes the key, preventing unnecessary errors while maintaining consistency with the existing theme rendering system. 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
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request adds support for the response color override in custom themes by updating the settings schema definitions and the corresponding JSON schema. A regression test has been added to settings-validation.test.ts to ensure that the text.response property is correctly validated. I have no feedback to provide.
jacob314
left a comment
There was a problem hiding this comment.
Code Review
This is a clear and necessary fix.
Correctness: The PR correctly adds the missing response key to the CustomTheme text schema in settingsSchema.ts and rebuilds the JSON schema. This perfectly aligns the runtime Zod validation with the existing CustomTheme TypeScript interface in @google/gemini-cli-core (which already had response?: string;).
Testability: A regression test is included to ensure validateSettings properly accepts the text.response property.
Other: The CI failures you observed in the workflow (Testing: CI and Testing: Slow Test) were unrelated test runner/infrastructure flakiness. They run successfully locally.
Approving! Great catch.
|
@cynthialong0-0 could you take a look at the CI results and help me figure out what caused the failure? It looks like an intermittent CI issue to me, but happy to dig deeper if you're seeing something different. |
|
@gaurav0107 — quick FYI in case it helps unstick things, I poked at the failing job and the evidence points strongly to a known flake unrelated to your change. Sharing the bullets in case they're useful for your next ping:
Might be worth including those four points the next time you ask for a re-run — "intermittent CI issue" without the file/test mismatch evidence is harder for a busy maintainer to confirm at a glance. With them spelled out, anyone with retrigger rights can verify in 30 seconds. |
Summary
The
text.responsecolor override is documented at https://geminicli.com/docs/cli/themes/#changing-themes and is implemented in the runtime theme system (seepackages/cli/src/ui/themes/theme.tsandsemantic-tokens.ts), but it was missing from theCustomThemevalidation schema.Because settings validation is built from
SETTINGS_SCHEMA_DEFINITIONS.CustomThemeviabuildZodSchemaFromJsonSchemainsettings-validation.ts(withadditionalProperties: falsetranslating to Zod.strict()), any user with aui.customThemes.<name>.text.responsecolor override saw an "Unrecognized key(s) in object: 'response'" error on every CLI invocation, even though the value was actually applied correctly at render time.Changes
response: { type: 'string' }to thetextproperties of theCustomThemedefinition inpackages/cli/src/config/settingsSchema.ts.schemas/settings.schema.jsonvianpm run schema:settings(autogenerated from the TypeScript source).settings-validation.test.tsusing the exact reproduction from the issue.How to validate
Or run the unit test:
npx vitest run packages/cli/src/config/settings-validation.test.ts -t "text.response"Fixes #25610