sessions welcome flow: fix stale session after sign in#297481
Merged
joshspicer merged 1 commit intomainfrom Feb 24, 2026
Merged
sessions welcome flow: fix stale session after sign in#297481joshspicer merged 1 commit intomainfrom
joshspicer merged 1 commit intomainfrom
Conversation
…istration After the welcome overlay completes (extension installed + user signed in), restart the extension host so the copilot-chat extension picks up the new auth session cleanly. Without this, the extension activates before the auth provider is ready, gets stuck in GitHubLoginFailed, and models never appear. The overlay stays visible during the restart so the user doesn't see a broken intermediate state. Dismiss is controlled by the contribution via an autorun watching isComplete, not by the overlay itself.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes a stale session issue in the Agent Sessions welcome flow by restarting the extension host after the user completes setup (extension installed + signed in). Without this restart, the copilot-chat extension activates before the auth provider is ready and gets stuck in a failed state, preventing models from appearing.
Changes:
- Move dismiss control from overlay to contribution via autorun watching
isComplete - Restart extension host when welcome flow completes, keeping overlay visible during restart
- Make
dismiss()public onSessionsWelcomeOverlayfor external control
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/vs/sessions/contrib/welcome/browser/welcome.contribution.ts | Add IExtensionService and ILogService dependencies; implement autorun to detect completion and call new restartExtensionHostThenDismiss() method; move storage write from onDidDismiss to autorun |
| src/vs/sessions/contrib/welcome/browser/sessionsWelcomeOverlay.ts | Remove auto-dismiss logic from overlay's autorun (still reads isComplete for reactivity); change dismiss() from private to public |
Comments suppressed due to low confidence (2)
src/vs/sessions/contrib/welcome/browser/welcome.contribution.ts:167
- The async method restartExtensionHostThenDismiss lacks cancellation support. If the overlay is disposed while the extension host is restarting, the method will continue to execute and call overlay.dismiss() on a potentially disposed object. Consider accepting a CancellationToken parameter and checking for cancellation before calling overlay.dismiss(), similar to patterns seen in src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.ts:225-265.
private async restartExtensionHostThenDismiss(overlay: SessionsWelcomeOverlay): Promise<void> {
this.logService.info('[sessions welcome] Restarting extension host after welcome completion');
const stopped = await this.extensionService.stopExtensionHosts(
localize('sessionsWelcome.restart', "Completing sessions setup")
);
if (stopped) {
await this.extensionService.startExtensionHosts();
}
overlay.dismiss();
}
src/vs/sessions/contrib/welcome/browser/sessionsWelcomeOverlay.ts:139
- The dismiss() method can be called multiple times (e.g., from restartExtensionHostThenDismiss at line 166), which will schedule multiple timeouts that each call this.dispose(). While this.dispose() is idempotent, multiple calls are unnecessary. Consider adding a guard flag (e.g., private dismissed = false) to ensure dismiss() only executes once, similar to how actionRunning is used in the button click handler.
dismiss(): void {
this.overlay.classList.add('sessions-welcome-overlay-dismissed');
this._onDidDismiss.fire();
// Allow CSS transition to finish before disposing
const handle = setTimeout(() => this.dispose(), 200);
this._register(toDisposable(() => clearTimeout(handle)));
}
Yoyokrazy
approved these changes
Feb 24, 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.
After the welcome overlay completes (extension installed + user signed in), restart the extension host so the copilot-chat extension picks up the new auth session cleanly. Without this, the extension activates before the auth provider is ready, gets stuck in GitHubLoginFailed, and models never appear.
The overlay stays visible during the restart so the user doesn't see a broken intermediate state. Dismiss is controlled by the contribution via an autorun watching isComplete, not by the overlay itself.
The copilot-chat code is really tangled and I don't see a safe way to fix this in the extension itself during endgame week.