mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-11 05:30:03 -05:00
* fix: validate copilotTelemetryURL in GitHub telemetry sender (fixes #321454) The applicationinsights Sender throws TypeError: Invalid URL when the copilotTelemetryURL from @vscode/copilot-api is a malformed URL string. The new vscode-extension-telemetry reporter (introduced in #3331) passed it to AppInsightsClientOptions.endpointUrl without validation, unlike the old AzureInsightReporter which guards with URL.canParse(). Mirror that guard so the default endpoint is kept when the URL is invalid. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: use ChatResponsePart action for task_complete summary Co-authored-by: vijayupadya <41652029+vijayupadya@users.noreply.github.com> --------- Co-authored-by: vs-code-engineering[bot] <122617954+vs-code-engineering[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: vijayupadya <41652029+vijayupadya@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9c9181c14c
commit
da43e2c55d
@@ -179,7 +179,6 @@ function createGitHubTelemetryReporter(
|
||||
};
|
||||
|
||||
const appInsightsOptions: AppInsightsClientOptions = {
|
||||
endpointUrl: capiClientService.copilotTelemetryURL,
|
||||
commonProperties: commonProps,
|
||||
// Static tag overrides (set once, applied to all events)
|
||||
tagOverrides: {
|
||||
@@ -188,6 +187,14 @@ function createGitHubTelemetryReporter(
|
||||
}
|
||||
};
|
||||
|
||||
// Only override the default endpoint when the telemetry URL is a valid URL. The
|
||||
// applicationinsights Sender calls `new URL(endpointUrl)` and throws "Invalid URL"
|
||||
// for malformed values; mirror AzureInsightReporter's guard and keep the default.
|
||||
const telemetryURL = capiClientService.copilotTelemetryURL;
|
||||
if (telemetryURL && URL.canParse(telemetryURL)) {
|
||||
appInsightsOptions.endpointUrl = telemetryURL;
|
||||
}
|
||||
|
||||
// Pass customFetcher to use the extension's fetcher service (handles proxy/cert/fallbacks)
|
||||
const newReporter = new TelemetryReporter(
|
||||
key,
|
||||
|
||||
Reference in New Issue
Block a user