fix(core): handle resume/update invalid-argument failures#20434
fix(core): handle resume/update invalid-argument failures#20434alexaustin007 wants to merge 1 commit intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello @alexaustin007, 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 and resolves Highlights
Changelog
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
This is a comprehensive pull request that effectively addresses the invalid-argument failures during session resume and update flows. The introduction of full-history thoughtSignature normalization with require and strip modes is a robust solution. The compatibility retry on invalid-argument errors is a clever way to handle model differences gracefully. Furthermore, the deduplication of function calls during session resume and the UX hardening for the auto-update process are excellent improvements to the tool's reliability and user experience. The accompanying tests are thorough and cover the new logic well.
| const parsedResult = JSON.parse(result); | ||
| expect(parsedResult.response).toContain('List complete.'); |
There was a problem hiding this comment.
There appears to be an issue with the assertion in this test. The test simulates two runs. The first run consumes the first two responses from the fixture, with the last model response being "List complete.". The second run, which is being asserted on here, consumes the third response from the fixture, which is "Resume complete.". Therefore, the assertion should check for "Resume complete." to correctly validate the behavior of the second run.
| const parsedResult = JSON.parse(result); | |
| expect(parsedResult.response).toContain('List complete.'); | |
| const parsedResult = JSON.parse(result); | |
| expect(parsedResult.response).toContain('Resume complete.'); |
Summary
This PR fixes the
Request contains an invalid argumentfailures seen after resume/update flows (Issue #18811)Details
Core request normalization:
requirefor modern models (add syntheticthoughtSignaturewhere missing)stripfor non-modern paths (removethoughtSignature)Session resume robustness:
convertSessionToClientHistory(), deduplicated function calls that appear in bothmsg.contentandmsg.toolCalls.idfirstCLI update UX hardening:
/help,/about, and/quit.Test updates:
Related Issues
How to Validate
Pre-Merge Checklist