Skip to content

Show sign-in dialog when delegating to session targets while unauthenticated#307257

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/add-copilot-cli-login-prompt
Draft

Show sign-in dialog when delegating to session targets while unauthenticated#307257
Copilot wants to merge 2 commits into
mainfrom
copilot/add-copilot-cli-login-prompt

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

Delegating to Copilot CLI, Cloud, or other remote session targets while signed out produces a non-actionable error ("Authorization failed. Please sign into GitHub and try again.") instead of prompting the user to sign in. The Local session already handles this correctly via CHAT_SETUP_ACTION_ID.

Adds the same ChatEntitlement.Unknown + !anonymous guard used by the Local session's setup flow to all three delegation entry points:

  • SubmitAction.handleDelegation() — session target picker sends
  • CreateRemoteAgentJobAction.run() — "Continue in…" dropdown
  • CreateRemoteAgentJobFromEditorAction.run() — editor context menu "Continue in…"

When the guard triggers, CHAT_SETUP_ACTION_ID is invoked to show the sign-in dialog. If the user completes sign-in, delegation proceeds normally. If dismissed, the action is silently aborted.

…ticated

When a user tries to delegate to Copilot CLI, Cloud, or other session
targets while not signed in, trigger the sign-in/setup dialog instead of
letting the request fail with a non-actionable error.

The sign-in check is added to three entry points:
- SubmitAction.handleDelegation() for the session target picker
- CreateRemoteAgentJobAction.run() for the "Continue in..." dropdown
- CreateRemoteAgentJobFromEditorAction.run() for the editor context menu

This matches the existing Local session behavior where the setup dialog
is shown when the user's entitlement is Unknown and anonymous access is
not enabled.

Fixes #296117

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/12f524df-1f4f-414c-b3bc-5ce531b1b112

Co-authored-by: cwebster-99 <60238438+cwebster-99@users.noreply.github.com>
Copilot AI changed the title [WIP] Add login prompt for unauthenticated Copilot CLI users Show sign-in dialog when delegating to session targets while unauthenticated Apr 1, 2026
Copilot AI requested a review from cwebster-99 April 1, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copilot CLI does not prompt user to login if they are unauthenticated

2 participants