Skip to content

[remote-copilot-sdk] Documentation so an LLM can author a manifest + agent session for a remote Copilot SDK session #1320

Description

@JoshuaRowePhantom

Part of #1313

Summary

Ship the documentation that lets an LLM (or a human) author a valid agent manifest and start an agent session for the [remote-copilot-sdk] topology described by the split set: a local router + persistence on the source, a remote CopilotSdkChatClient on a user-computer-profile reached over the reverse transport, and a split executor topology where workspace-gui / workspace-entity / source-targeted agent-session / current-session tools execute LOCAL on the source while all other tools (plus the Copilot SDK's built-in tools) execute REMOTE on the SDK's user-computer-profile.

Concretely this bug delivers:

  • A new example manifest (docs/examples/github-copilot-remote-chat.json) that demonstrates every field an LLM needs to emit for this topology.
  • A dedicated section in the manifest reference (documentation/agent-options-providers.md — the github-copilot and BYOK openai / azure-openai entries) documenting remote hosting: how host-profile-entity-id on the resulting agent-session entity targets a user-computer-profile, and how TrustProfile.HostingWorkspacesClientInstances / TrustProfile.DefaultExecutionTarget + ExecutorTopology express the local/remote split.
  • Cross-links from the design doc referenced by the master (docs/design/remote-chat-client-session.md) and the existing github-copilot-provider-support.md, session-context-tools.md, and llm-trust-profile.md.
  • An entry in docs/examples/README.md for the new example.
  • A test that the new example manifest loads (extending ExampleAgentDefinitionsTests).

The acceptance target is: given only the docs listed here, an LLM can emit a valid manifest for the remote Copilot SDK topology, know which fields select the remote user-computer-profile, know that its workspace-gui / workspace-entity / source-targeted agent-session tool calls will run on the source, and know that its github-copilot (or openai / azure-openai BYOK) chat client + built-in shell tool will run on the remote profile.

Dependencies

Current State / What's Missing

Investigation (paths cited relative to features/):

Existing surfaces the manifest already covers:

  • docs/examples/github-copilot-chat.json — the only existing github-copilot example, but it is single-machine (no remote-hosting fields). No example demonstrates remote hosting or the split tool topology.
  • docs/examples/README.md — enumerates every current example; has no entry for a remote-hosting variant.
  • Phantom.Workspaces.Data.Core/JsonEntities/documentation/agent-options-overview.md — the top-level index. Does not mention remote hosting or host-profile-entity-id selection.
  • Phantom.Workspaces.Data.Core/JsonEntities/documentation/agent-options-providers.md — documents github-copilot and BYOK openai / azure-openai (CopilotSdkChatClient). No mention of remote hosting or how the SDK's built-in tools land on the remote profile.
  • Phantom.Workspaces.Data.Core/JsonEntities/documentation/agent-options-tools.md — documents tool kinds. Does not describe the local/remote split of tool execution.
  • Phantom.Workspaces.Data.Core/JsonEntities/documentation/agent-options-connections.md — documents CopilotByokOptions connection fields for BYOK.
  • Phantom.Workspaces.Data.Core/JsonEntities/documentation/agent-options-parameters.md — documents working-directory and notes the future trust-profile parameter. Needs to describe how the trust-profile parameter (with HostingWorkspacesClientInstances on the resolved llm-trust-profile) selects the remote host.
  • Phantom.Workspaces.Data.Core/JsonEntities/documentation/agent-configuration.md — already documents host-profile-entity-id on agent-session as "Entity ID of the user-computer-profile hosting this session" (see also Phantom.Workspaces.Data.Core/JsonSchemas/agent-session.json:24). Needs a remote-hosting worked example.
  • docs/design/github-copilot-provider-support.md — the design for the github-copilot provider (CopilotSdkChatClient). No cross-link yet to remote-chat-client-session or the split topology.
  • docs/design/session-context-tools.md:28-31, 99-103, 200-206 — already correctly documents that host-profile-entity-id records where the session was last hosted but is not the source of truth for the current run; the live host's profile/user is used. This is directly relevant to the doc-set and must be cross-linked.
  • docs/design/llm-trust-profile.md — currently only a stub. Needs (or must cross-link to) documentation of TrustProfile.HostingWorkspacesClientInstances (Phantom.Workspaces.Llm.Core/Trust/TrustProfile.cs:99, 137) and TrustProfile.DefaultExecutionTarget (ibid. lines 105, 143).

What is missing (this bug):

  1. No example manifest exists under docs/examples/ that demonstrates the remote Copilot SDK topology (github-copilot provider + a remote user-computer-profile execution target + the split tool set). This is the single biggest gap for the LLM authoring path.
  2. agent-options-providers.md has no "Remote hosting" subsection for github-copilot / BYOK explaining that (a) the resulting agent-session records host-profile-entity-id = the remote user-computer-profile entity id, (b) the SDK's built-in tools (shell, filesystem) execute on that remote host, and (c) the CLI process and Copilot session id live on the remote host while persistence stays on the source.
  3. agent-options-tools.md has no description of the split executor topology: which tool kinds are ExecutorTarget.GuiLocal (workspace-gui, workspace-entity), which are ExecutorTarget.HostingInstance (source-targeted agent-session / current-session), and which are ExecutorTarget.AgentExecutor (all other tools + SDK built-ins). Cite Phantom.Workspaces.Llm.Core/Transport/ExecutorTarget.cs:9-28 and Phantom.Workspaces.Llm.Core/Transport/ExecutorTopology.cs:10-44.
  4. agent-options-parameters.md needs to describe the interaction between the (future) trust-profile parameter and remote hosting: the resolved TrustProfile.HostingWorkspacesClientInstances list constrains which user-computer-profiles the session may be hosted on; TrustProfile.DefaultExecutionTarget supplies the connection descriptor when the manifest does not override it.
  5. docs/examples/README.md needs a section describing the new example (matching the style of the existing github-models-chat-with-mongodb.json write-up).
  6. docs/design/remote-chat-client-session.md — referenced by master [remote-copilot-sdk] End-to-end test missing: Copilot-SDK-BYOK AgentChat with source-session tool + built-in PowerShell tool + persistence round-trip #1313 as the design doc. If not already committed alongside [remote-copilot-sdk] Complete + host server-side chat-client transport listener (builds CopilotSdkChatClient from AgentDefinition) #1314/[remote-copilot-sdk] Split executor topology: GUI + workspace-entity + source-targeted session tools LOCAL, other tools REMOTE #1317, commit it here with cross-links from github-copilot-provider-support.md and llm-trust-profile.md.
  7. documentation/agent-configuration.md — extend the agent-session schema section (currently only single-machine example) with a remote-hosting worked example showing host-profile-entity-id pointing at a remote user-computer-profile entity id, plus a note that agent-definition-reference still resolves against the source workspace so the same manifest reconstructs the session on resume.

Code fields the docs must cover (with paths):

  • Provider strings github-copilot, openai, azure-openai — dispatched in Phantom.Workspaces.Llm.Core/AgentFactory.cs.
  • Phantom.Workspaces.Llm.Core/CopilotByokOptions.cs:16-30 (Provider, BaseUrl, ApiKey) — BYOK connection fields already documented in agent-options-connections.md but must be cross-linked from the remote-hosting section.
  • Phantom.Workspaces.Llm.Core/Trust/TrustProfile.cs:99, 105, 137, 143HostingWorkspacesClientInstances, DefaultExecutionTarget. Also the sentinels TrustProfile.LocalClientInstance (".") and TrustProfile.WildcardClientInstance ("*").
  • Phantom.Workspaces.Llm.Core/Transport/ExecutorTarget.cs:9-28 (AgentExecutor / GuiLocal / HostingInstance) and Phantom.Workspaces.Llm.Core/Transport/ExecutorTopology.cs:10-44 (mapping to client instances).
  • Phantom.Workspaces.Data.Core/JsonSchemas/agent-session.json:24-27host-profile-entity-id (uuid of user-computer-profile).
  • Referencing a user-computer-profile by entity id — see documentation/user-computer-profile-schema.md.

Affected Files

Path Change Covers
features/docs/examples/github-copilot-remote-chat.json create New example manifest demonstrating github-copilot provider + trust-profile parameter + working-directory parameter targeting a remote user-computer-profile.
features/docs/examples/README.md update Add "Remote Copilot SDK" example section describing prerequisites (GITHUB_TOKEN on the remote profile, remote profile enrolled) and behavior (router + persistence local; SDK + built-in tools remote).
features/Phantom.Workspaces.Data.Core/JsonEntities/documentation/agent-options-providers.md update Add a "Remote hosting" subsection under github-copilot (and by reference under openai / azure-openai) covering host-profile-entity-id selection, split executor topology summary, and a link to the example.
features/Phantom.Workspaces.Data.Core/JsonEntities/documentation/agent-options-tools.md update Add a "Execution target of tool kinds" table mapping each tool kind to ExecutorTarget and, in a remote-hosted session, to source-local vs. remote-host.
features/Phantom.Workspaces.Data.Core/JsonEntities/documentation/agent-options-parameters.md update Expand the trust-profile (future) entry with HostingWorkspacesClientInstances / DefaultExecutionTarget semantics and how the manifest opts into remote hosting.
features/Phantom.Workspaces.Data.Core/JsonEntities/documentation/agent-options-overview.md update Add a "Remote hosting" bullet under top-level agent definition fields, linking to the providers and tools entities.
features/Phantom.Workspaces.Data.Core/JsonEntities/documentation/agent-configuration.md update Add a remote-hosting worked example alongside the existing single-machine agent-session example.
features/docs/design/remote-chat-client-session.md ensure exists + cross-link The master's design doc. Cross-link from github-copilot-provider-support.md, llm-trust-profile.md, and session-context-tools.md.
features/docs/design/github-copilot-provider-support.md update Add a "Remote hosting" section (short) linking to remote-chat-client-session.md.
features/docs/design/llm-trust-profile.md update Document (or link to code + remote-chat-client-session.md) HostingWorkspacesClientInstances and DefaultExecutionTarget.
features/Phantom.Workspaces.Llm.Core.Tests/ExampleAgentDefinitionsTests.cs update Add LoadGithubCopilotRemoteChat_ValidatesSuccessfully (see Expected Tests).
features/Phantom.Workspaces.Llm.Core.Tests/Phantom.Workspaces.Llm.Core.Tests.csproj update Add <EmbeddedResource Include="..\docs\examples\github-copilot-remote-chat.json" Link="github-copilot-remote-chat.json" />.

Design / Fix

Structure of the new example manifest

The new features/docs/examples/github-copilot-remote-chat.json demonstrates every field an LLM needs to emit. Sketch:

{
  "kind": "prompt",
  "name": "github-copilot-remote-chat",
  "displayName": "GitHub Copilot Chat (remote host)",
  "description": "GitHub Copilot SDK chat client hosted on a remote user-computer-profile; router and persistence stay on the source.",
  "model": {
    "id": "gpt-5",
    "provider": "github-copilot",
    "connection": {
      "kind": "key",
      "apiKey": "${GITHUB_TOKEN}"
    },
    "options": {
      "working-directory": "${working-directory}"
    }
  },
  "instructions": "You are a helpful assistant running on a remote Phantom.Workspaces user-computer-profile. The router and persistence live on the source instance; your built-in shell tool runs here.",
  "parameters": {
    "properties": [
      {
        "name": "working-directory",
        "kind": "string",
        "description": "Working directory the Copilot CLI uses on the remote host.",
        "required": true
      },
      {
        "name": "trust-profile",
        "kind": "string",
        "description": "Name of an llm-trust-profile whose HostingWorkspacesClientInstances lists the remote user-computer-profile.",
        "required": true
      }
    ]
  },
  "tools": [
    { "kind": "workspace-gui" },
    { "kind": "workspace-entity" },
    { "kind": "current-session" },
    { "kind": "filesystem" },
    { "kind": "github-cli-builtin-tools" }
  ],
  "metadata": {
    "version": "1.0",
    "tags": ["github-copilot", "copilot-sdk", "remote", "split-executor"],
    "prerequisites": [
      "The remote user-computer-profile is enrolled and reachable via the reverse-tunnel transport.",
      "An llm-trust-profile exists whose HostingWorkspacesClientInstances contains the remote profile entity id.",
      "GITHUB_TOKEN with Copilot access is available on the remote host (or the remote user is signed in to the Copilot CLI)."
    ]
  }
}

The example intentionally uses parameters (not literal values) for both working-directory and trust-profile so the Launchpad UI collects them. The trust-profile parameter is what selects the remote user-computer-profile: the resolved TrustProfile.HostingWorkspacesClientInstances names the remote instance, and TrustProfile.DefaultExecutionTarget supplies the connection descriptor. The agent-session entity written at launch records host-profile-entity-id = that remote profile's entity id (per agent-configuration.md and agent-session.json:24).

Documentation outline (structure of the new subsections)

agent-options-providers.md, new "Remote hosting" subsection under github-copilot:

  1. How a session becomes remote-hosted. The trust-profile parameter resolves an llm-trust-profile whose HostingWorkspacesClientInstances names a non-"." client instance. AgentFactory records the selected host on the agent-session entity's host-profile-entity-id. On session resume, the router reads that field and forwards the chat client to the remote instance.

  2. What runs where. Table:

    Component Source (local) Remote user-computer-profile
    AgentChat router, steering, persistence
    CopilotSdkChatClient + Copilot CLI process
    Copilot SDK built-in tools (shell, filesystem)
    workspace-gui / workspace-entity tool calls
    Source-targeted agent-session / current-session tools
    Other function / mcp tools ✔ (ExecutorTarget.AgentExecutor)
  3. BYOK variant. openai / azure-openai follow the same rules; the BYOK CopilotByokOptions fields (Provider, BaseUrl, ApiKey) come from the model connection and are honored on the remote host.

  4. Cross-links to docs/design/remote-chat-client-session.md, session-context-tools.md, agent-options-tools.md#execution-target-of-tool-kinds, and documentation/agent-configuration.md.

agent-options-tools.md, new "Execution target of tool kinds" section:

Tool kind ExecutorTarget Runs on
workspace-gui GuiLocal source (initiating machine)
workspace-entity GuiLocal source
agent-session / current-session (targeting source session id) HostingInstance source (host of the source session)
filesystem, web_request, mcp, function, chat-history, github-cli-builtin-tools AgentExecutor remote profile in a remote-hosted session; source in single-machine
Copilot SDK built-in tools (shell, etc.) (SDK self-invokes) wherever CopilotSdkChatClient runs → remote in a remote-hosted session

agent-options-parameters.md, expand the trust-profile entry: (a) resolves an llm-trust-profile entity by name, (b) HostingWorkspacesClientInstances selects the remote host — "." = source, "*" = any (per TrustProfile.cs:131-134), any other value = a remote client instance id, (c) DefaultExecutionTarget supplies the connection descriptor used to reach the remote instance.

Cross-linking plan

  • docs/design/github-copilot-provider-support.md gets a new "Remote hosting" subsection linking to docs/design/remote-chat-client-session.md.
  • docs/design/llm-trust-profile.md gets a short "Hosting client instances" subsection linking to the same design.
  • docs/design/session-context-tools.md already covers the "host follows the current run, not the persisted host-profile-entity-id" rule; add a cross-link from remote-chat-client-session.md.
  • The example manifest's README entry links back to the two documentation entities (agent-options-providers, agent-options-tools).

Expected Tests

Documentation is not unit-tested per line, but the example manifest is machine-validated by the existing example-manifest test class Phantom.Workspaces.Llm.Core.Tests/ExampleAgentDefinitionsTests.cs (which today already contains LoadGithubCopilotChat_ValidatesSuccessfully at line 184, calling AgentDefinitionLoader.LoadAgentFromJson on the embedded resource). We extend it — we do not propose a new test class.

Test (extend ExampleAgentDefinitionsTests) Purpose
LoadGithubCopilotRemoteChat_ValidatesSuccessfully Loads the new github-copilot-remote-chat.json embedded resource via AgentDefinitionLoader.LoadAgentFromJson; asserts model.provider == "github-copilot", the working-directory and trust-profile parameters exist and are required, and the tools list contains at least one GuiLocal tool kind (workspace-gui) and at least one AgentExecutor tool kind. Matches the shape of LoadGithubCopilotChat_ValidatesSuccessfully.

Also requires Phantom.Workspaces.Llm.Core.Tests.csproj to add an <EmbeddedResource Include="..\docs\examples\github-copilot-remote-chat.json" ... /> entry alongside the existing example resources (lines 39-45).

Documentation acceptance checklist (verifiable by reading the merged docs)

  • docs/examples/github-copilot-remote-chat.json exists and is added as an embedded resource in Phantom.Workspaces.Llm.Core.Tests.csproj.
  • ExampleAgentDefinitionsTests.LoadGithubCopilotRemoteChat_ValidatesSuccessfully passes.
  • docs/examples/README.md has a section describing the new example (prerequisites, behavior, split tool topology).
  • documentation/agent-options-providers.md has a "Remote hosting" subsection under github-copilot covering host-profile-entity-id, the local/remote split table, and BYOK.
  • documentation/agent-options-tools.md has an "Execution target of tool kinds" table covering all current tool kinds.
  • documentation/agent-options-parameters.md's trust-profile entry documents HostingWorkspacesClientInstances and DefaultExecutionTarget.
  • documentation/agent-options-overview.md links to the new remote-hosting section.
  • documentation/agent-configuration.md includes a remote-hosting worked example for agent-session.
  • docs/design/remote-chat-client-session.md exists (or is committed here) and is cross-linked from github-copilot-provider-support.md, llm-trust-profile.md, and session-context-tools.md.
  • Every mention of the split topology cites ExecutorTarget / ExecutorTopology by path so future readers can find the code.

Metadata

Metadata

Labels

bugSomething isn't workingdiagnosedRoot cause identifiedverified-locallyImplementation has been verified locally

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions