Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds AB experiment context propagation to CAPI (Copilot API) requests by injecting the experiment assignment context as a custom HTTP header. When telemetry updates experiment assignments, the context is now stored in the CAPI client service and automatically included in all CAPI requests via the VScode-ABExpContext header.
- Modified
BaseTelemetryServiceto accept and store a reference toICAPIClientService - Extended
ICAPIClientServiceinterface and implementation to store and inject AB experiment context - Updated experiment assignment logic to propagate context to CAPI client for header injection
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/platform/telemetry/common/baseTelemetryService.ts | Added ICAPIClientService parameter to constructor and updated experiment assignment method to set abExpContext on the CAPI client service |
| src/platform/telemetry/vscode-node/telemetryServiceImpl.ts | Updated super() call to pass capiClientService to base class constructor |
| src/platform/endpoint/common/capiClient.ts | Extended interface and implementation to include abExpContext property and override makeRequest to inject the context as a custom header |
| private _disposables: IDisposable[] = []; | ||
| constructor( | ||
| protected readonly _tokenStore: ICopilotTokenStore, | ||
| private readonly _capiClientServiece: ICAPIClientService, |
There was a problem hiding this comment.
Spelling error in parameter name: _capiClientServiece should be _capiClientService (missing 'r' in "Service").
| private readonly _capiClientServiece: ICAPIClientService, | |
| private readonly _capiClientService: ICAPIClientService, |
| value += `;${assignment}`; | ||
| } | ||
| } | ||
| this._capiClientServiece.abExpContext = value; |
There was a problem hiding this comment.
The same spelling error appears here. The variable name _capiClientServiece should be _capiClientService (missing 'r' in "Service").
* Send abexp context * Spelling
No description provided.