fix(core): propagate User-Agent header to setup-phase CodeAssist API calls - #19182
Conversation
Pass httpOptions (containing User-Agent) from createCodeAssistContentGenerator through setupUser to the CodeAssistServer used during the setup phase. Previously, loadCodeAssist, onboardUser, and getOperation calls had no User-Agent header because setupUser instantiated CodeAssistServer with empty httpOptions.
Summary of ChangesHello @gsquared94, 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 critical CodeAssist API calls during the initial setup phase were missing 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
This pull request correctly propagates the User-Agent header to setup-phase CodeAssist API calls by passing httpOptions through createCodeAssistContentGenerator and setupUser to the CodeAssistServer. The changes are well-implemented and include updated unit tests and a new test case to validate the fix. The code is clean and effectively addresses the issue. I have no further comments.
8979fc5
Summary
Propagate
User-Agentheader to setup-phase CodeAssist API calls.Details
During the setup phase of CodeAssist, certain API calls (
loadCodeAssist,onboardUser) were being made without theUser-Agentheader. This occurred becausesetupUserwas instantiatingCodeAssistServerwith an emptyhttpOptionsobject. This PR updatessetupUserto accepthttpOptionsand pass them when instantiatingCodeAssistServer, and ensurescreateCodeAssistContentGeneratorpasses itshttpOptionstosetupUser.Related Issues
Fixes #19181
How to Validate
Check sherlog traces for missing
user-agentheader now available. Sample:Pre-Merge Checklist