Skip to content

fix(core): prioritize structured display titles in tool invocation#27863

Open
aniruddhaadak80 wants to merge 1 commit into
google-gemini:mainfrom
aniruddhaadak80:fix/acp-tool-call-titles
Open

fix(core): prioritize structured display titles in tool invocation#27863
aniruddhaadak80 wants to merge 1 commit into
google-gemini:mainfrom
aniruddhaadak80:fix/acp-tool-call-titles

Conversation

@aniruddhaadak80

Copy link
Copy Markdown
Contributor

Fixes #23018

@aniruddhaadak80 aniruddhaadak80 requested a review from a team as a code owner June 12, 2026 15:56
@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 updates the getDisplayTitle method within the BaseToolInvocation class to ensure that structured display names and tool names are prioritized over the default description. This change improves the consistency of tool identification in the UI and includes updated test cases to validate the new behavior.

Highlights

  • Logic update for getDisplayTitle: Updated the getDisplayTitle method in BaseToolInvocation to prioritize _toolDisplayName and _toolName before falling back to the default description.
  • Test coverage: Added comprehensive unit tests to verify the new prioritization logic for tool display titles.
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 Jun 12, 2026
@github-actions

Copy link
Copy Markdown

📊 PR Size: size/S

  • Lines changed: 24
  • Additions: +23
  • Deletions: -1
  • Files changed: 2

@github-actions

Copy link
Copy Markdown

🛑 Action Required: Evaluation Approval

Steering changes have been detected in this PR. To prevent regressions, a maintainer must approve the evaluation run before this PR can be merged.

Maintainers:

  1. Go to the Workflow Run Summary.
  2. Click the yellow 'Review deployments' button.
  3. Select the 'eval-gate' environment and click 'Approve'.

Once approved, the evaluation results will be posted here automatically.

@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 getDisplayTitle method in BaseToolInvocation to prioritize _toolDisplayName and _toolName before falling back to getDescription(), and adds corresponding unit tests. The feedback suggests trimming these optional string properties before evaluating their truthiness to prevent whitespace-only strings from being displayed as empty titles in the CLI.

Comment on lines 175 to 177
getDisplayTitle(): string {
return this.getDescription();
return this._toolDisplayName || this._toolName || this.getDescription();
}

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.

high

If _toolDisplayName or _toolName are provided as whitespace-only strings (e.g., " "), they will be evaluated as truthy and returned as the display title, resulting in blank or empty titles in the CLI. Trimming these values before checking their truthiness ensures a robust fallback to the tool description.

Suggested change
getDisplayTitle(): string {
return this.getDescription();
return this._toolDisplayName || this._toolName || this.getDescription();
}
getDisplayTitle(): string {
return this._toolDisplayName?.trim() || this._toolName?.trim() || this.getDescription();
}
References
  1. When using an optional string with a fallback value, trim the optional string and use the fallback if the result is empty to avoid uninformative messages from whitespace-only strings.

@gemini-cli gemini-cli Bot added priority/p1 Important and should be addressed in the near term. area/non-interactive Issues related to GitHub Actions, SDK, 3P Integrations, Shell Scripting, Command line automation help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! labels Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/non-interactive Issues related to GitHub Actions, SDK, 3P Integrations, Shell Scripting, Command line automation help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! priority/p1 Important and should be addressed in the near term. size/s A small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACP: Execute tool call title field contains conversational text.

1 participant