Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds request/fetch observability by requiring a callSite identifier on IRequestOptions, emitting a request-completion event from IRequestService, and logging a new fetchCall telemetry event from workbench telemetry services. It also propagates callSite across a number of existing network call sites (profiles, updates, extensions, chat, MCP, sessions GitHub fetchers) and updates tests accordingly.
Changes:
- Add
IRequestOptions.callSite,NO_FETCH_TELEMETRY, andIRequestService.onDidCompleteRequest(latency/status/callSite). - Log
fetchCalltelemetry in workbench telemetry services based ononDidCompleteRequest. - Thread
callSitethrough many request/download call sites and adjust tests/APIs (includingIDownloadService.download).
Reviewed changes
Copilot reviewed 48 out of 48 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts | Adds callSite to profile template fetch request. |
| src/vs/workbench/services/userDataProfile/browser/userDataProfileInit.ts | Adds callSite to initial profile contents fetch request. |
| src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.ts | Adds callSite to profile import/export content fetch request. |
| src/vs/workbench/services/telemetry/electron-browser/telemetryService.ts | Logs fetchCall telemetry from IRequestService completion events. |
| src/vs/workbench/services/telemetry/browser/telemetryService.ts | Logs fetchCall telemetry from IRequestService completion events. |
| src/vs/workbench/services/extensionManagement/electron-browser/nativeExtensionManagementService.ts | Adds callSite to VSIX download. |
| src/vs/workbench/services/extensionManagement/electron-browser/extensionManagementService.ts | Adds callSite to remote VSIX download. |
| src/vs/workbench/services/extensionManagement/electron-browser/extensionGalleryManifestService.ts | Adds callSite to gallery manifest fetch request. |
| src/vs/workbench/services/chat/common/chatEntitlementService.ts | Threads callSite through entitlement request helper and call site. |
| src/vs/workbench/services/accounts/browser/defaultAccount.ts | Threads callSite through account entitlement request helper and call sites. |
| src/vs/workbench/contrib/update/browser/releaseNotesEditor.ts | Adds callSite to release notes fetch request. |
| src/vs/workbench/contrib/themes/test/node/colorRegistry.releaseTest.ts | Adds callSite to docs fetch in test. |
| src/vs/workbench/contrib/extensions/electron-browser/extensionsSlowActions.ts | Adds callSite to GitHub search request. |
| src/vs/workbench/contrib/emergencyAlert/electron-browser/emergencyAlert.contribution.ts | Adds callSite to emergency alert fetch request. |
| src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts | Adds callSite to plugin list fetch request. |
| src/vs/workbench/contrib/chat/common/languageModels.ts | Adds callSite to chat control fetch request. |
| src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.ts | Adds callSite to prompt URL resolution fetch request. |
| src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.ts | Adds callSite to README fetch request. |
| src/vs/workbench/api/browser/mainThreadDownloadService.ts | Adds callSite to main-thread download API usage. |
| src/vs/sessions/contrib/github/test/browser/githubFetchers.test.ts | Updates mock GitHub client to accept callSite. |
| src/vs/sessions/contrib/github/browser/githubApiClient.ts | Adds callSite to REST/GraphQL API methods and forwards to request service. |
| src/vs/sessions/contrib/github/browser/fetchers/githubRepositoryFetcher.ts | Adds callSite for GitHub repository fetch. |
| src/vs/sessions/contrib/github/browser/fetchers/githubPRFetcher.ts | Adds callSite for GitHub PR-related REST/GraphQL calls. |
| src/vs/sessions/contrib/github/browser/fetchers/githubPRCIFetcher.ts | Adds callSite for GitHub CI/check-run requests. |
| src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.ts | Adds callSite for GitHub tree/readFile requests. |
| src/vs/server/node/webClientServer.ts | Adds callSite for server fetch-and-write request. |
| src/vs/platform/userDataSync/test/common/userDataSyncStoreService.test.ts | Updates mock request service to include onDidCompleteRequest and call sites in tests. |
| src/vs/platform/userDataSync/test/common/userDataSyncClient.ts | Updates test server request service to include onDidCompleteRequest. |
| src/vs/platform/userDataSync/common/userDataSyncStoreService.ts | Adds callSite for all sync-store network operations. |
| src/vs/platform/update/electron-main/updateService.win32.ts | Adds callSite for update check/download requests. |
| src/vs/platform/update/electron-main/updateService.linux.ts | Adds callSite for update check request. |
| src/vs/platform/update/electron-main/updateService.darwin.ts | Adds callSite for update check request. |
| src/vs/platform/update/electron-main/abstractUpdateService.ts | Adds callSite for “is latest version” request. |
| src/vs/platform/telemetry/node/1dsAppender.ts | Uses NO_FETCH_TELEMETRY to prevent fetch telemetry loops from telemetry sender. |
| src/vs/platform/request/test/node/requestService.test.ts | Adds callSite to node request tests. |
| src/vs/platform/request/test/common/requestService.test.ts | New unit tests for AbstractRequestService.onDidCompleteRequest. |
| src/vs/platform/request/common/requestIpc.ts | Adds onDidCompleteRequest to IPC client interface (currently Event.None). |
| src/vs/platform/request/common/request.ts | Introduces NO_FETCH_TELEMETRY, request completion event, and event emission in AbstractRequestService. |
| src/vs/platform/mcp/common/mcpGalleryService.ts | Adds callSite to MCP gallery requests. |
| src/vs/platform/mcp/common/mcpGalleryManifestService.ts | Adds callSite to MCP manifest version check request. |
| src/vs/platform/extensionResourceLoader/common/extensionResourceLoaderService.ts | Adds callSite to extension gallery resource fetch. |
| src/vs/platform/extensionManagement/node/extensionManagementService.ts | Adds callSite to VSIX download in node extension management. |
| src/vs/platform/extensionManagement/common/extensionGalleryService.ts | Adds callSite across gallery queries/assets and refactors getAsset signature. |
| src/vs/platform/download/common/downloadService.ts | Makes callSite required for downloads and forwards to request service. |
| src/vs/platform/download/common/downloadIpc.ts | Updates download IPC to accept callSite (but currently doesn’t forward from client). |
| src/vs/platform/download/common/download.ts | Updates IDownloadService.download signature to require callSite. |
| src/vs/base/parts/request/test/electron-main/request.test.ts | Adds callSite to request tests. |
| src/vs/base/parts/request/common/request.ts | Makes IRequestOptions.callSite required at the base request layer. |
Comments suppressed due to low confidence (2)
src/vs/platform/download/common/downloadIpc.ts:41
DownloadServiceChannelClient.downloadaccepts acallSiteparameter but currently ignores it and always calls the channel with only[from, to], which makes the server-side default ('downloadIpc') get used for all IPC downloads. Forward the providedcallSite(and consider making it required to matchIDownloadService) so download telemetry/observability is attributed correctly.
async download(from: URI, to: URI, _callSite?: string): Promise<void> {
const uriTransformer = this.getUriTransformer();
if (uriTransformer) {
from = uriTransformer.transformOutgoingURI(from);
to = uriTransformer.transformOutgoingURI(to);
}
await this.channel.call('download', [from, to]);
}
src/vs/platform/request/common/requestIpc.ts:55
RequestChannelClientexposesonDidCompleteRequestasEvent.None, andRequestChannel.listenthrows for all events. In environments whereIRequestServiceis consumed over IPC (or whereBrowserRequestServicefalls back to a remoteRequestChannelClientrequest), request-completion observability will be missing. Consider wiringonDidCompleteRequestthrough the channel (implementlisteninRequestChanneland forward it from the client).
export class RequestChannel implements IServerChannel {
constructor(private readonly service: IRequestService) { }
listen(context: any, event: string): Event<any> {
throw new Error('Invalid listen');
}
call(context: any, command: string, args?: any, token: CancellationToken = CancellationToken.None): Promise<any> {
switch (command) {
case 'request': return this.service.request(args[0], token)
.then(async ({ res, stream }) => {
const buffer = await streamToBuffer(stream);
return <RequestResponse>[{ statusCode: res.statusCode, headers: res.headers }, buffer];
});
case 'resolveProxy': return this.service.resolveProxy(args[0]);
case 'lookupAuthorization': return this.service.lookupAuthorization(args[0]);
case 'lookupKerberosAuthorization': return this.service.lookupKerberosAuthorization(args[0]);
case 'loadCertificates': return this.service.loadCertificates();
}
throw new Error('Invalid call');
}
}
export class RequestChannelClient implements IRequestService {
declare readonly _serviceBrand: undefined;
readonly onDidCompleteRequest = Event.None as Event<IRequestCompleteEvent>;
constructor(private readonly channel: IChannel) { }
async request(options: IRequestOptions, token: CancellationToken): Promise<IRequestContext> {
const [res, buffer] = await this.channel.call<RequestResponse>('request', [options], token);
return { res, stream: bufferToStream(buffer) };
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @alexr00Matched files:
@joaomorenoMatched files:
|
rzhao271
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.