Repository navigation
Desktop app (Windows): enabling remote control fails with "Failed to set up remote session" — log shows "No authentication token available; remote export disabled" #4954
Description
Activity
Root cause found, with a minimal reproduction. This also happens on macOS, not only Windows.
Environment: GitHub Copilot app 1.1.23 (macOS arm64) with its bundled CLI 1.0.87-0. Also reproduced with the standalone CLI builds 1.0.88 and 1.0.89-3.
Summary:
session.remote.enablefails for a session whose working directory is a GitHub repository whenever the session has a session-level GitHub credential (gitHubTokenProvider, or a sessiongitHubToken). The desktop app authenticates its sessions with a per-session token provider (its process logs referenceGitHub token provider registration "<uuid>"), so remote control can never be enabled for repository-backed project sessions. General chats can still be exported read-only because their working directory is not a repository, and that path does use the session credential.Reproduction, using the SDK bundled in the app (
/Applications/GitHub Copilot.app/Contents/Resources/copilot-sdk) and the app's own CLI binary, withGH_TOKENset in the environment:import { CopilotClient, RuntimeConnection } from "/Applications/GitHub Copilot.app/Contents/Resources/copilot-sdk/index.js"; const client = new CopilotClient({ connection: RuntimeConnection.forStdio({ path: `${process.env.HOME}/Library/Caches/github-copilot-sdk/cli/1.0.87-0/copilot`, args: ["--no-auto-update", "--log-level", "debug"], }), }); await client.start(); const session = await client.createSession({ workingDirectory: process.argv[2], // a clone of any GitHub repository onPermissionRequest: () => ({ kind: "reject" }), // Remove this callback and remote.enable succeeds: gitHubTokenProvider: () => ({ kind: "token", accessToken: process.env.GH_TOKEN, tokenType: "bearer", expiresIn: 28800 }), }); try { console.log(await session.rpc.remote.enable({ mode: "export" })); } catch (e) { console.log("remote.enable failed:", e.message); } await session.disconnect(); await client.stop();
Session credential Working directory remote.enablenone (process-level GH_TOKENonly)GitHub repository ✅ https://github.com/<owner>/<repo>/tasks/<id>gitHubTokenProviderGitHub repository ❌ Failed to set up remote session. Ensure the working directory is a GitHub repository and you are authenticated.session gitHubTokenGitHub repository ❌ same error gitHubTokenProvidernot a repository ✅ read-only, https://github.com/copilot/tasks/<id>The remote URL form makes no difference:
https://github.com/...,ssh://git@github.com/...andgit@github.com:...fail the same way. Everything else (binary, environment, process working directory, account, repository) was identical between the passing and failing runs.Log evidence (
--log-level debug). The passing and failing runs differ only in these lines:- [DEBUG] Set auth info on session <id> + [DEBUG] Set auth context on session <id> + [WARNING] [rust:remote::shared_api] No authentication token available; remote export disabled
The provider callback is invoked once, at session creation (
reason: "initial",host: "https://github.com"), and is not called again duringremote.enable. In the CLI'sapp.js, thesession.createhandler callsauthManager.applySessionAuthContext(...)when the session has a credential registration andapplySessionCredentials(...)otherwise. The native remote exporter's repository path appears to read only the credential set by the latter, so it finds no token. The non-repository path does use the session's credential.Signing in to the standalone CLI (
copilot login), restarting the app, and pushing or re-tracking the branch do not help, because the failing lookup never consults those credentials.This appears to be resolved as of GitHub Copilot CLI v1.0.92. Please update to that release or a newer stable version. We're closing this as completed. If it still happens, please comment with your version and reproduction steps.
Describe the bug
In the GitHub Copilot desktop app on Windows, remote control can't be turned on for a session. Every attempt fails with:
The working directory is a GitHub repository and the app is signed in. The runtime log shows the same warning at startup and on each enable attempt:
The app has a working GitHub token in other contexts. Inside the session,
gh auth statussucceeds (logged in viaGH_TOKEN, scopes includerepo,workflow,read:org), and the GitHub MCP server connects without problems. The remote module seems to be the only part that can't get a token.Affected version
Desktop app runtime version 1.0.87-0. The standalone
copilotCLI is not installed on this machine.Steps to reproduce the behavior
originishttps://github.com/<owner>/<repo>.git).~\.copilot\logs\process-*.logshowsNo authentication token available; remote export disabledat the time of the attempt.Things that did not help:
originand setting upstream trackingExpected behavior
Remote control turns on and the session can be managed from GitHub Mobile, using the app's existing GitHub sign-in.
Additional context
...github-copilot-appentry (the app's sign-in), but there's no standalone Copilot CLI sign-in entry.~\.copilot\config.jsonhas nologged_in_usersorlast_logged_in_user.server policy fetch skipped: no authenticated GitHub host availablebefore the account is picked up later.cli_remote_control_enabledis false — desktop setting is inert and GitHub Mobile returns a bare HTTP 422 #4409.