Fix cli_help output to return only answer field [issue: #19463]#19620
Fix cli_help output to return only answer field [issue: #19463]#19620aashishgrinds wants to merge 1 commit intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello @aashishgrinds, 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 Highlights
Changelog
Activity
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. 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
|
There was a problem hiding this comment.
Code Review
The pull request successfully addresses the issue where the cli_help agent was outputting a full JSON object to the terminal. By updating the processOutput function to return only the answer field, the user experience is improved with cleaner, text-only responses. The corresponding unit tests have been updated to verify this change. No high or critical severity issues were identified during the review.
Summary
Fixes CLI output formatting when delegating to the cli_help subagent. Previously, the CLI would output the full JSON object including internal metadata like sources. Now it only outputs the actual answer text to users, eliminating confusing internal reasoning text.
Details
The cli_help agent was using processOutput: (output) => JSON.stringify(output, null, 2) which returned the complete response object. Changed to processOutput: (output) => output.answer to return only the user-facing answer. This affects only the final display output - internal agent logic and schema validation remain unchanged.
Updated the corresponding unit test to expect only the answer field instead of the full JSON string.
Related Issues

Fixes #19463 - CLI prints internal reasoning text when delegating to cli_help subagent instead of only showing the answer.
Fixed this as you can see in the screenshot above
NOTE:-
Not validated on MacOS/Linux (Windows only).
Pre-Merge Checklist