-
Notifications
You must be signed in to change notification settings - Fork 10.3k
fix(patch): cherry-pick fcb85e6 to release/v0.19.3-pr-14092 to patch version v0.19.3 and create version 0.19.4 #14588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @gemini-cli-robot, 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 automates the creation of a new patch release, v0.19.4, by cherry-picking a critical fix into the v0.19.3 stable branch. The primary change implemented by the cherry-picked commit focuses on enhancing error logging for Large Language Model (LLM) stream failures, ensuring that more comprehensive diagnostic information is captured when unexpected issues occur. 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. 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.
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 cherry-picks a fix to improve error logging for LLM stream errors by including the event payload. While this is a good improvement for debuggability, the current implementation introduces a critical risk of crashing the server due to a potential TypeError from JSON.stringify on objects with circular references. My review includes a comment with a suggestion to make the error handling more robust.
| ); | ||
|
|
||
| let errMessage = 'Unknown error from LLM stream'; | ||
| let errMessage = `Unknown error from LLM stream: ${JSON.stringify(event)}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using JSON.stringify(event) directly is risky as it will throw a TypeError if the event object contains circular references. This can lead to an unhandled promise rejection and potentially crash the server process.
To make this robust, please wrap the JSON.stringify call in a try...catch block. For example:
let errMessage: string;
try {
errMessage = `Unknown error from LLM stream: ${JSON.stringify(event)}`;
} catch {
errMessage = 'Unknown error from LLM stream (event could not be stringified).';
}Alternatively, since this is a Node.js environment, consider using util.inspect(), which is safer for debugging as it handles circular references gracefully.
|
Size Change: -2 B (0%) Total Size: 21.4 MB ℹ️ View Unchanged
|
This PR automatically cherry-picks commit fcb85e6 to patch version v0.19.3 in the stable release to create version 0.19.4.