Skip to content

fix(cli): add missing response key to custom theme text schema#25822

Merged
cynthialong0-0 merged 5 commits intogoogle-gemini:mainfrom
gaurav0107:fix/25610-theme-response-key-validation
Apr 27, 2026
Merged

fix(cli): add missing response key to custom theme text schema#25822
cynthialong0-0 merged 5 commits intogoogle-gemini:mainfrom
gaurav0107:fix/25610-theme-response-key-validation

Conversation

@gaurav0107
Copy link
Copy Markdown
Contributor

Summary

The text.response color override is documented at https://geminicli.com/docs/cli/themes/#changing-themes and is implemented in the runtime theme system (see packages/cli/src/ui/themes/theme.ts and semantic-tokens.ts), but it was missing from the CustomTheme validation schema.

Because settings validation is built from SETTINGS_SCHEMA_DEFINITIONS.CustomTheme via buildZodSchemaFromJsonSchema in settings-validation.ts (with additionalProperties: false translating to Zod .strict()), any user with a ui.customThemes.<name>.text.response color 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

  • Add response: { type: 'string' } to the text properties of the CustomTheme definition in packages/cli/src/config/settingsSchema.ts.
  • Regenerate schemas/settings.schema.json via npm run schema:settings (autogenerated from the TypeScript source).
  • Add a regression test in settings-validation.test.ts using the exact reproduction from the issue.

How to validate

# From the issue:
cat > /tmp/settings.json <<'JSON'
{
  "ui": {
    "theme": "LimeWhite",
    "customThemes": {
      "LimeWhite": {
        "type": "custom",
        "name": "LimeWhite",
        "text": {
          "primary": "#00FF00",
          "response": "#FFFFFF",
          "secondary": "#a0a0a0",
          "accent": "#00FF00"
        }
      }
    }
  }
}
JSON

# Before the fix: "Unrecognized key(s) in object: 'response'"
# After the fix: validates cleanly.

Or run the unit test:

npx vitest run packages/cli/src/config/settings-validation.test.ts -t "text.response"

Fixes #25610

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
@gaurav0107 gaurav0107 requested a review from a team as a code owner April 22, 2026 19:22
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • Schema Update: Added the missing 'response' key to the CustomTheme text properties schema to align with existing runtime theme capabilities.
  • Regression Testing: Introduced a new unit test in settings-validation.test.ts to ensure custom themes with 'text.response' color overrides are correctly validated.
  • Schema Synchronization: Regenerated the autogenerated settings.schema.json to reflect the updated TypeScript schema definitions.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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.

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.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 22, 2026

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.

Copy link
Copy Markdown
Contributor

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

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 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.

@gemini-cli gemini-cli Bot added area/core Issues related to User Interface, OS Support, Core Functionality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! labels Apr 22, 2026
@jacob314 jacob314 self-requested a review April 23, 2026 17:24
Copy link
Copy Markdown
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

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.

@gaurav0107
Copy link
Copy Markdown
Contributor Author

@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.

@pmenic
Copy link
Copy Markdown

pmenic commented Apr 26, 2026

@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:

  • The failing test is run_shell_command.test.ts > should reject commands not on the allowlist on Windows E2E only — Linux and Mac E2E both passed.
  • Your diff only touches the custom-theme color schema in packages/cli/src/config/settingsSchema.ts:3197 plus the matching regression test, so there's no code-path overlap with shell-command policy.
  • The failure mode is "model didn't call the expected tool in time" — Poll timed out after 146 attempts, with retry x2 and all three retries timing out the same way. That looks like a model-latency / runner-load symptom rather than a correctness regression.
  • This same test was previously disabled in Re-enable run_shell_command.test.ts > run_shell_command > should reject commands not on the allowlist #11336 for the same reason and re-enabled afterwards, so the flake history is documented.

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.

@cynthialong0-0 cynthialong0-0 added this pull request to the merge queue Apr 27, 2026
Merged via the queue into google-gemini:main with commit 743518e Apr 27, 2026
27 checks passed
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 help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug Report: Gemini CLI - Theme Validation Error for text.response key

5 participants