




















11---
2-summary: "Run OpenClaw embedded agent turns through the bundled GitHub Copilot SDK harness"
2+summary: "Run OpenClaw embedded agent turns through the external GitHub Copilot SDK harness"
33title: "Copilot SDK harness"
44read_when:
5- - You want to use the bundled GitHub Copilot SDK harness for an agent
5+ - You want to use the GitHub Copilot SDK harness for an agent
66 - You need configuration examples for the `copilot` runtime
77 - You are wiring an agent to subscription Copilot (github / openclaw / copilot) and want it to run through the Copilot CLI
88---
9910-The bundled `copilot` extension lets OpenClaw run embedded subscription
10+The external `@openclaw/copilot` plugin lets OpenClaw run embedded subscription
1111Copilot agent turns through the GitHub Copilot CLI (`@github/copilot-sdk`)
1212instead of the built-in PI harness.
1313@@ -24,11 +24,11 @@ For the broader model/provider/runtime split, start with
24242525## Requirements
262627-- OpenClaw with the bundled `copilot` extension available.
27+- OpenClaw with the `@openclaw/copilot` plugin installed.
2828- If your config uses `plugins.allow`, include `copilot` (the manifest
29- id in `extensions/copilot/openclaw.plugin.json`). A restrictive
29+ id declared by the plugin). A restrictive
3030 allowlist that uses the npm-style `@openclaw/copilot` package name
31- will leave the bundled plugin blocked and the runtime will not load
31+ will leave the plugin blocked and the runtime will not load
3232 even with `agentRuntime.id: "copilot"`.
3333- A GitHub Copilot subscription that can drive the Copilot CLI (or a
3434`gitHubToken` env / auth-profile entry for headless / cron runs).
@@ -38,56 +38,38 @@ For the broader model/provider/runtime split, start with
3838 or `~/.config/copilot` elsewhere) is used as the doctor probe fallback when
3939 no explicit home is set.
404041-`openclaw doctor` runs the bundled
41+`openclaw doctor` runs the plugin
4242[doctor contract](#doctor-and-probes) for the extension; failures there are
4343the canonical way to confirm the environment is ready before opting an agent
4444in.
454546-## On-demand SDK install
46+## Plugin install
474748-The Copilot agent runtime ships its small TypeScript code bundled inside
49-the openclaw tarball, but the underlying `@github/copilot-sdk` package
50-(and its platform-specific `@github/copilot-<platform>-<arch>` CLI
51-binary) is **not** installed by default — together they add ~260 MB to
52-your openclaw install footprint, and most openclaw users do not select
53-a Copilot model.
48+The Copilot runtime is an external plugin so the core `openclaw` package does
49+not carry the `@github/copilot-sdk` dependency or its platform-specific
50+`@github/copilot-<platform>-<arch>` CLI binary. Together they add roughly
51+260 MB, so install them only for agents that opt into this runtime:
545255-The wizard offers to install the SDK the first time you select a
53+```bash
54+openclaw plugins install @openclaw/copilot
55+```
56+57+The wizard installs the plugin the first time you select a
5658`github-copilot/*` model **and** your config opts the model (or its
5759provider) into the Copilot agent runtime via
5860`agentRuntime: { id: "copilot" }` (see [Quickstart](#quickstart) below).
5961Without the opt-in, openclaw uses its built-in GitHub Copilot provider
60-and never prompts for the SDK install:
61-62-```
63-The Copilot agent runtime needs @github/copilot-sdk (~260 MB on first
64-install, downloads the @github/copilot CLI binary for your platform).
65-Install now? [Y/n]
66-```
67-68-If you accept, the SDK is installed into
69-`~/.openclaw/npm-runtime/copilot/` and detected on subsequent runs. The
70-install runs `npm ci` against a checked-in `package-lock.json` shipped
71-with openclaw at
72-`src/commands/copilot-sdk-install-manifest/package-lock.json`, so the
73-exact transitive graph reviewed for this release lands on disk on every
74-user machine.
75-76-If you decline, the runtime will fail at first invocation with an
77-actionable install message; re-run `openclaw setup` to retry the install
78-(or copy the pinned manifest into `~/.openclaw/npm-runtime/copilot/` and
79-run `npm ci` yourself if you need to install offline).
62+and never installs the runtime plugin.
80638164The runtime resolves the SDK in this order:
826583-1. `import("@github/copilot-sdk")` against the host openclaw install
84- (covers source/dev checkouts and any environment that pre-installs
85- the SDK alongside openclaw).
66+1. `import("@github/copilot-sdk")` from the installed `@openclaw/copilot`
67+ package.
86682. The well-known fallback dir `~/.openclaw/npm-runtime/copilot/` (the
87-wizard install target).
69+legacy on-demand install target).
88708971A missing SDK surfaces a single error with code `COPILOT_SDK_MISSING`
90-and the manual install command above.
72+and the plugin reinstall command above.
91739274## Quickstart
9375此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。