How to Share Locally Hosted Copilot SDK Sessions to GitHub Web via Mission Control

You can expose local Copilot SDK sessions on GitHub.com by enabling remote support during session creation, which automatically generates a hidden GitHub task accessible through Mission Control's shareable URL.

The GitHub Copilot SDK enables developers to run AI-assisted coding sessions locally, but you can also surface these sessions on GitHub.com through Mission Control. According to the github/copilot-sdk source code, this integration creates a remote-backed task that represents your local session, allowing collaborative debugging and code review directly through the GitHub web interface.

Enabling Remote Session Support

To initiate the sharing workflow, you must create a session with the remote option set to true. This flag, defined in nodejs/src/types.ts within the SessionOptions interface, instructs the SDK to establish a connection with Mission Control and create a corresponding GitHub task.

When you call client.session.create({ remote: true }), the SDK allocates a local session ID and begins the background sync process to GitHub's remote infrastructure. Unlike standard local sessions, remote-backed sessions cannot use local message APIs after creation.

Checking Sync Status and Retrieving the Shareable URL

Once the session exists, you must wait for the sync operation to complete before accessing the shareable link. The client.session.getState() method returns a state object containing a status field and the shareUrl property.

According to the RPC definitions in nodejs/src/generated/rpc.ts (lines 17731-17738), the status object includes a synced boolean that indicates whether the session has been successfully pushed to Mission Control. When status.synced equals true, the shareUrl field contains a URL in the format https://github.com/<owner>/<repo>/tasks/<task-id>.

Poll the session state until synchronization completes:

let state = await client.session.getState(sessionId);
while (!state.status?.synced) {
  await new Promise(r => setTimeout(r, 500));
  state = await client.session.getState(sessionId);
}
const shareUrl = state.shareUrl;

Controlling Session Visibility

By default, newly created remote sessions may have restricted visibility. The client.session.setVisibility() method allows you to modify who can access the session on GitHub.

As implemented in nodejs/src/generated/rpc.ts (lines 20832-20839), this method accepts a session ID and a visibility string—either "repo" (visible to all repository readers) or "unshared" (visible only to the creator and collaborators). The method returns the updated state including the current shareUrl.

// Make visible to all repository readers
await client.session.setVisibility(sessionId, "repo");

Limitations of Remote-Backed Sessions

Mission Control sessions operate differently from purely local sessions. According to comments in nodejs/src/generated/rpc.ts (lines 19041-19043), remote-backed sessions cannot use the sendUserMessage or runTurn APIs. Attempting to call these methods on a Mission Control session returns an error.

You must perform all local interactions before the session syncs, or use the Mission Control web UI to resume and interact with the session after it has been shared.

Complete Implementation Example

The following TypeScript example demonstrates the complete workflow from session creation to sharing:

import { CopilotClient } from "@github/copilot-sdk";

// Initialize client pointing to your local SDK server
const client = new CopilotClient({
  endpoint: "http://localhost:7777",
});

// 1. Create session with Mission Control support
const { sessionId } = await client.session.create({ remote: true });

// 2. Poll until synced to GitHub
let state = await client.session.getState(sessionId);
while (!state.status?.synced) {
  await new Promise(r => setTimeout(r, 500));
  state = await client.session.getState(sessionId);
}

// 3. Extract shareable URL
console.log("GitHub URL:", state.shareUrl);

// 4. Optional: Expand visibility to repository readers
await client.session.setVisibility(sessionId, "repo");

// 5. Cleanup when finished
await client.session.close(sessionId);

Summary

  • Enable remote support by passing remote: true to client.session.create() to initiate Mission Control integration.
  • Monitor synchronization by checking state.status.synced via client.session.getState() until the session appears on GitHub.
  • Retrieve the share link from the shareUrl property once syncing completes, typically formatted as a GitHub task URL.
  • Adjust visibility using client.session.setVisibility() to choose between repository-wide ("repo") or restricted ("unshared") access.
  • Avoid local message APIs like sendUserMessage on remote-backed sessions; interaction must occur before sync or through the GitHub web UI.

Frequently Asked Questions

What is Mission Control in the context of the Copilot SDK?

Mission Control is GitHub's hosted "remote-control" service that allows locally running Copilot SDK sessions to be exposed as interactive tasks on GitHub.com. When you enable remote session support, the SDK creates a hidden GitHub task that represents your local session, enabling collaborative debugging and code review through the GitHub web interface.

How do I check if my Copilot SDK session has synced to Mission Control?

Call client.session.getState(sessionId) and examine the status.synced boolean field. According to the RPC client implementation in nodejs/src/generated/rpc.ts, this field returns true only after the session has been successfully pushed to GitHub's Mission Control infrastructure and the shareUrl becomes available.

Can I send messages to a Mission Control session using the SDK's sendUserMessage API?

No. As noted in the source code comments at lines 19041-19043 of nodejs/src/generated/rpc.ts, remote-backed Mission Control sessions do not support the sendUserMessage or runTurn APIs. All user interactions must occur locally before synchronization, or you must use the Mission Control web interface to resume the session after it has been shared.

What visibility options are available for shared Copilot SDK sessions?

The client.session.setVisibility() method supports two visibility levels: "repo" makes the session visible to anyone with read access to the repository, while "unshared" restricts visibility to the session creator and specific collaborators. This method is defined in nodejs/src/generated/rpc.ts and returns the updated session state including the current share URL.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →