608
609
async getNetworkDiagnosticsEndpoints(): Promise<readonly IAgentHostNetworkEndpoint[]> {
610
>
let capiUrl = process.env['VSCODE_AGENT_HOST_CAPI_URL_OVERRIDE'] || COPILOT_CAPI_URL;
copilotAgent.ts
611
>
if (this._githubToken) {
612
>
try {
613
>
capiUrl = await this._copilotApiService.resolveApiEndpoint(this._githubToken) || capiUrl;
614
>
} catch (error) {
615
this._logService.debug(`[Copilot] CAPI endpoint discovery for network diagnostics failed; using ${capiUrl}: ${error instanceof Error ? error.message : String(error)}`);
616
}
618
>
const capiPingUrl = new URL(capiUrl);
619
>
capiPingUrl.pathname = `${capiPingUrl.pathname.replace(/\/$/, '')}/_ping`;
620
>
return [
621
>
{ name: 'GitHub API', url: this._gitHubEndpointService.getApiBaseUri() },
622
>
{ name: 'Copilot API (CAPI)', url: capiPingUrl.toString() },
623
>
];
624
>
}
625
626
async getNetworkDiagnosticsAccount(): Promise<string | undefined> {
627
>
return this._githubToken ? this._copilotApiService.resolveUserLogin?.(this._githubToken) : undefined;
copilotAgent.ts
628
>
}
629
630
async getManagedSettingsDiagnostics(): Promise<IAgentHostManagedSettingsSnapshot> {