471
this._transportMode = this._resolveTransportMode();
472
this._register(this._configurationService.onDidRootConfigChange(() => {
474
>
if (next !== this._transportMode) {
475
>
this._transportMode = next;
476
>
// Proxy and native enumerate different catalogs. Do not retain
477
>
// models from the previous transport if the replacement cannot
478
>
// enumerate its own list.
479
>
this._models.set([], undefined);
480
>
void this._startModelRefresh();
481
>
// Flipping into proxy makes GitHub Copilot auth newly required.
482
>
// If no proxy handle was ever established, proactively ask the
483
>
// client to authenticate rather than waiting for the next command
484
>
// to fail with `AHP_AUTH_REQUIRED`. A handle persists across a
485
>
// proxy→native→proxy round-trip (cleared only on dispose), so this
486
>
// fires only when a credential is genuinely missing.
487
>
if (next === 'proxy' && !this._proxyHandle) {
488
this._onDidRequireAuth.fire({
489
resource: this._gitHubEndpointService.getCopilotResource().resource,