fix(core): record response's modelVersion in session transcript#25633
fix(core): record response's modelVersion in session transcript#25633nadja-y wants to merge 1 commit intogoogle-gemini:mainfrom
Conversation
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 ensures that the session transcript accurately reflects the model version returned by the server during streaming responses. By capturing the model version from the response chunks, the system correctly handles scenarios where aliasing or A/B routing causes the actual model used to diverge from the requested model, ensuring consistency in telemetry and logging. 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 introduces logic to capture the specific model version from the response stream in GeminiChat, ensuring that the recorded message reflects the actual model used rather than the initial request model. A potential runtime error was identified where the code attempts to access a property on a potentially null or undefined stream chunk.
b7937f3 to
dd91275
Compare
GeminiChat.processStreamResponse wrote the pre-request resolved model to the session record, ignoring chunk.modelVersion from the server. On aliasing / A/B routing the two diverge, and uiTelemetry.hydrate() keys per-model stats on message.model. Align with LoggingContentGenerator which already uses responses[0]?.modelVersion || req.model for telemetry. Fixes google-gemini#25632
dd91275 to
aa34b29
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the GeminiChat class to capture the specific model version from the response stream. The captured observedModel is then used when recording the message via chatRecordingService, falling back to the default model name if the version is not available in the stream. I have no feedback to provide.
|
Sent with Notion Mail <https://www.notion.so/product/mail>
On Apr 18, 2026 at 6:58 PM gemini-code-assist[bot] ***@***.***> wrote:
***@***.***[bot]* commented on this pull request.
Code Review
This pull request updates the GeminiChat class to capture the specific
model version from the response stream. The captured observedModel is then
used when recording the message via chatRecordingService, falling back to
the default model name if the version is not available in the stream. I
have no feedback to provide.
—
Reply to this email directly, view it on GitHub
<#25633?email_source=notifications&email_token=A6DTLFMYV6NYHEZKK32GLTT4WQQCVA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIMJTGUZTGMZWHEY2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOS6XA4S7OJSXM2LFO5PW433UNFTGSY3BORUW63TTL5RWY2LDNM#pullrequestreview-4135333691>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A6DTLFMARLB7J2XXTF6E74T4WQQCVAVCNFSM6AAAAACX6DASLWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DCMZVGMZTGNRZGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Fixes #25632.
GeminiChat.processStreamResponsewrote the pre-request resolved model to the session record, ignoringchunk.modelVersionfrom the server. On aliasing / A/B routing the two diverge, anduiTelemetry.hydrate()keys per-model stats onmessage.model.Aligned with
LoggingContentGeneratorwhich already usesresponses[0]?.modelVersion || req.modelfor telemetry.