diff --git a/vscode/src/services/AuthProvider.ts b/vscode/src/services/AuthProvider.ts index 766f988f6e65..aa09019e8ac2 100644 --- a/vscode/src/services/AuthProvider.ts +++ b/vscode/src/services/AuthProvider.ts @@ -16,7 +16,6 @@ import { clientCapabilities as getClientCapabilities, isAbortError, normalizeServerEndpointURL, - pluck, resolvedConfig as resolvedConfig_, setAuthStatusObservable as setAuthStatusObservable_, startWith, @@ -111,10 +110,21 @@ class AuthProvider implements vscode.Disposable { // Keep context updated with auth status. this.subscriptions.push( - authStatus.pipe(pluck('authenticated')).subscribe(authenticated => { + authStatus.subscribe(authStatus => { try { - vscode.commands.executeCommand('setContext', 'cody.activated', authenticated) - } catch {} + vscode.commands.executeCommand( + 'setContext', + 'cody.activated', + authStatus.authenticated + ) + vscode.commands.executeCommand( + 'setContext', + 'cody.serverEndpoint', + authStatus.endpoint + ) + } catch (error) { + logError('AuthProvider', 'Unexpected error while setting context', error) + } }) )