Skip to content

fix(cli): pass config to getDisplayString in Footer for custom model displayName - #30490

Open
bitwizard25 wants to merge 1 commit into
google-gemini:mainfrom
bitwizard25:fix/footer-custom-model-display-name
Open

bitwizard25 wants to merge 1 commit into
google-gemini:mainfrom
bitwizard25:fix/footer-custom-model-display-name

Conversation

@bitwizard25

Copy link
Copy Markdown

Summary

Passes config to getDisplayString(model, config) in Footer.tsx so custom model definitions with a configured displayName are resolved in the footer.

Root Cause

Footer.tsx called getDisplayString(model) without passing the config instance that is already in scope via useConfig(). Without config, getDisplayString skips custom modelConfigService lookups and returns the raw model identifier verbatim. For Vertex AI fully qualified resource paths (e.g. projects/.../locations/.../publishers/google/models/...), the raw string exceeds the remaining footer width budget at standard terminal widths (e.g. 120 columns), causing the width-fitting logic to drop the model-name column and render an ellipsis (…).

Changes

  • packages/cli/src/ui/components/Footer.tsx: Pass config to getDisplayString(model, config) in the model-name footer item.
  • packages/cli/src/ui/components/Footer.test.tsx: Add a regression test verifying that a long Vertex AI model resource path with a configured displayName renders the short displayName at 120 columns instead of dropping model info.

Testing

  • Added regression test in packages/cli/src/ui/components/Footer.test.tsx (confirmed failing before the fix with model column dropped to …).
  • Ran npx vitest run packages/cli/src/ui/components/Footer.test.tsx (41/41 passing).
  • Ran npx prettier --check and npx eslint --max-warnings 0 on both modified files.

Fixes #30482

@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 addresses an issue where the CLI footer failed to display user-defined model names for certain providers. By correctly injecting the configuration context into the display string logic, the application can now resolve custom display names, preventing the UI from falling back to verbose, long-form resource paths that would otherwise cause layout issues.

Highlights

  • Configuration Injection: Updated the Footer component to pass the configuration object to the getDisplayString helper function.
  • Custom Model Display Names: Ensured that custom model display names are correctly resolved and rendered in the CLI footer, preventing long resource paths from causing UI truncation.
  • Regression Testing: Added a new test case to verify that long Vertex AI model paths are correctly displayed using their configured aliases.
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 the 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 counterproductive. 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. ↩

@github-actions github-actions Bot added the size/s A small PR label Nov 27, 2026
@github-actions

Copy link
Copy Markdown

📊 PR Size: size/S

  • Lines changed: 43
  • Additions: +42
  • Deletions: -1
  • Files changed: 2

@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 updates the Footer component to pass the config object to getDisplayString when rendering the model-name column. It also adds a unit test in Footer.test.tsx to verify that a custom configured displayName is correctly displayed for long Vertex AI model resource paths instead of truncating or dropping the model information. There are no review comments, so I have no feedback to provide.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s A small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Footer ignores custom model displayName and drops Vertex AI model info despite hideModelInfo=false

1 participant