Skip to content

remoteTunnel: explain the GitHub sign-in before sharing via Dev Tunnels - #350641

Merged
Christof Marti (chrmarti) merged 1 commit into
mainfrom
chrmarti/tunnel-share-sign-in
Nov 27, 2026
Merged

Christof Marti (chrmarti) merged 1 commit into
mainfrom
chrmarti/tunnel-share-sign-in

Conversation

@chrmarti

Copy link
Copy Markdown
Collaborator

Sharing this computer through Dev Tunnels from the Remote Connections menu in the Agents window (and Share This Computer in Remote Environments) opened the browser for a GitHub sign-in without any explanation. This happens when no GitHub session with the tunnel permissions (user:email, read:org) can be used.

A dialog now explains why a sign-in is needed before the browser opens, and lets the user cancel:

  • Message: "Sign in with GitHub to share this computer?"
  • Detail, depending on the reason:
    • Not signed in: "Dev tunnels use your GitHub account so that only you can connect to this computer. Your browser will open for you to sign in."
    • Signed in, but the session lacks the tunnel permissions: "... You're signed in, but dev tunnels also need permission to read your email address and organizations. Your browser will open for you to allow this."
    • The tunnel service rejected the session: "... Your current sign-in no longer works for dev tunnels, so your browser will open for you to sign in again."
  • Buttons: Sign In, Cancel. Canceling returns 'canceled', which the menu and the This Computer setup already treat as a cancel, without an error.

The editor window's Turn on Remote Tunnel Access is unchanged: its account picker already asks the user to choose "Sign in with GitHub".

How to test

  1. In the Agents window, sign out of GitHub, or use a GitHub session without the read:org scope.
  2. Open the Remote Connections menu (antenna in the title bar) and choose Dev Tunnels.
  3. A dialog explains the sign-in before the browser opens. Cancel leaves sharing off without an error; Sign In continues as before.

Validation

  • pnpm run build-fast --client-only: passed
  • .\scripts\test.bat --reporter dot --run src/vs/workbench/contrib/remoteTunnel/test/electron-browser/remoteTunnel.contribution.test.ts --run src/vs/workbench/contrib/chat/test/electron-browser/toggleRemoteConnectionsActionViewItem.test.ts --run src/vs/sessions/contrib/tunnelHost/test/electron-browser/tunnelHost.contribution.test.ts: passed (111 passing). The four new cases fail without the change.
  • pnpm run typecheck-client: passed
  • node build/oxlint.ts and node build/hygiene.ts on the changed files: passed

Not run: the dialog in a running Code OSS window, and the GitHub sign-in in the browser.

Sharing this computer through Dev Tunnels from the Agents window opened the browser to sign in to GitHub without saying why. A dialog now explains first that dev tunnels use the GitHub account so that only its owner can connect, and why a sign-in is needed: the user isn't signed in, the existing session lacks the permission to read their email address and organizations, or the tunnel service no longer accepts it. Declining cancels sharing without reporting an error.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 09:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the Dev Tunnels sign-in confirmation change.

No open issues 🎉

What changed in this PR

Adds an explanatory GitHub sign-in confirmation before starting Dev Tunnels sharing in the Agents window, while leaving the editor’s existing account-picker flow unchanged.

Changes:

  • Explains missing sign-in, missing permissions, or a rejected session before authentication begins.
  • Allows cancellation without starting authentication or a tunnel.
  • Adds tests for the three explanations and cancellation, and documents the behavior.

No actionable findings remain. The live dialog and browser sign-in flow were not manually validated.

File Description
src/​vs/​workbench/​contrib/​sessions/​providers/​remoteAgentHost/​REMOTE_AGENT_HOST_SESSIONS_PROVIDER.md Documents the sign-in explanation and cancellation behavior.
src/​vs/​workbench/​contrib/​remoteTunnel/​test/​electron-browser/​remoteTunnel.contribution.test.ts Tests each sign-in explanation and cancellation.
src/​vs/​workbench/​contrib/​remoteTunnel/​electron-browser/​remoteTunnel.contribution.ts Adds the confirmation dialog before GitHub authentication.

Review effort: Balanced

@chrmarti
Christof Marti (chrmarti) marked this pull request as ready for review November 27, 2026 10:30
@chrmarti
Christof Marti (chrmarti) added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 95fe7e4 Nov 27, 2026
98 of 100 checks passed
@chrmarti
Christof Marti (chrmarti) deleted the chrmarti/tunnel-share-sign-in branch November 27, 2026 12:52
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.

4 participants