fix(core): properly format markdown in AskUser tool by unescaping newlines#26349
fix(core): properly format markdown in AskUser tool by unescaping newlines#26349
Conversation
|
Size Change: +768 B (0%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
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 addresses a rendering issue where markdown content in the AskUser tool was failing to display correctly due to over-escaped newline characters. By introducing a normalization step that converts these escaped sequences into actual newline characters before the data reaches the UI, the tool now correctly identifies and renders block-level markdown elements. 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
|
There was a problem hiding this comment.
Code Review
This pull request updates dependency metadata in package-lock.json and introduces a normalization step in the AskUserTool to unescape double-escaped newline characters in question parameters. Unit tests were added to ensure correct behavior for various newline sequences. Feedback was provided to improve the robustness of the normalization logic by safely handling optional properties to prevent potential runtime errors.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
✅ 69 tests passed successfully on gemini-3-flash-preview. 🧠 Model Steering GuidanceThis PR modifies files that affect the model's behavior (prompts, tools, or instructions).
This is an automated guidance message triggered by steering logic signatures. |
…lines (google-gemini#26349) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…lines (google-gemini#26349) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Summary
This PR fixes an issue where markdown formatting (headers, lists, etc.) was not being applied in the `ask_user` tool because newlines were over-escaped as `\n` by the LLM.
Details
Modified `AskUserTool` to unescape `\n` and `\r\n` into actual newline characters in all user-facing string fields of the `questions` array (`question`, `header`, `placeholder`, `label`, `description`). This allows the UI's markdown renderer (`MarkdownDisplay`) to correctly identify block-level elements. Added unit tests to verify the normalization.
Related Issues
Fixes #25023
How to Validate
Pre-Merge Checklist