Skip to content

Commit f3cfd75

Browse files
authored
feat(copilot): add GitHub Copilot agent runtime
Adds the opt-in bundled GitHub Copilot agent runtime, pinned SDK install path, docs/inventory, SDK/tool/sandbox/auth wiring, and replay/tool-safety fixes. Verification: - Local: git diff --check; fnm exec --using 24.15.0 pnpm tsgo:extensions; fnm exec --using 24.15.0 pnpm check:test-types; fnm exec --using 24.15.0 pnpm build. - Autoreview local: clean for the replay-safety fix; branch autoreview engine returned empty output twice, so local autoreview plus local/Crabbox/CI proof was used. - Crabbox focused Copilot: run_2c0db9f48a4a, 19 files / 485 tests passed. - Crabbox additional boundary shard: run_26a246a1aa24, prompt snapshots and plugin SDK boundary/export checks passed. - Crabbox live Copilot: run_d128e4048b4e, real gpt-4.1 turn with live_echo phase-1-green and clean session-file check. - GitHub checks: green on head 7cc8657, including Dependency Guard after exact-head approval. Co-authored-by: Ramraj Balasubramanian <ramrajba@microsoft.com>
1 parent 15772c5 commit f3cfd75

114 files changed

Lines changed: 18524 additions & 228 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/labeler.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,11 @@
405405
- "extensions/codex-supervisor/**"
406406
- "docs/plugins/reference/codex-supervisor.md"
407407
- "docs/specs/claw-supervisor.md"
408+
"extensions: copilot":
409+
- changed-files:
410+
- any-glob-to-any-file:
411+
- "extensions/copilot/**"
412+
- "docs/plugins/copilot.md"
408413
"extensions: kimi-coding":
409414
- changed-files:
410415
- any-glob-to-any-file:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ mantis/
178178
/local/
179179
/client_secret_*.json
180180
package-lock.json
181+
!src/commands/copilot-sdk-install-manifest/package-lock.json
181182
.claude/
182183
.agent/
183184
skills-lock.json
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
91cb45dc1e8aaa3dac9a2c1d3c98c8ff22112e41c305de17f30d0d4420635ee4 plugin-sdk-api-baseline.json
2-
3aa4802ffcb68c4f15e367030994eae10e73b55b5f14c8e23d4e9467fae325fe plugin-sdk-api-baseline.jsonl
1+
28bbd7e0a05747ef3d17ae25e6dac5002d6cc9ad3256f1c4e58ee8e45014e397 plugin-sdk-api-baseline.json
2+
d1d3fe6599e6cbc64f069737d08099d6b2586bc2b9d8d2ddb00d9f6e35c87cc7 plugin-sdk-api-baseline.jsonl

docs/.i18n/glossary.zh-CN.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,26 @@
175175
"source": "Agent harness plugins",
176176
"target": "Agent harness plugins"
177177
},
178+
{
179+
"source": "Agent harness plugins (SDK reference)",
180+
"target": "Agent harness plugins (SDK reference)"
181+
},
182+
{
183+
"source": "Copilot SDK harness",
184+
"target": "Copilot SDK harness"
185+
},
186+
{
187+
"source": "Copilot plugin",
188+
"target": "Copilot plugin"
189+
},
190+
{
191+
"source": "GitHub Copilot agent runtime",
192+
"target": "GitHub Copilot agent runtime"
193+
},
194+
{
195+
"source": "copilot",
196+
"target": "copilot"
197+
},
178198
{
179199
"source": "Agent loop",
180200
"target": "Agent loop"

docs/concepts/agent-runtimes.md

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ the finished turn to OpenClaw.
1414
Runtimes are easy to confuse with providers because both show up near model
1515
configuration. They are different layers:
1616

17-
| Layer | Examples | What it means |
18-
| ------------- | ------------------------------------- | ------------------------------------------------------------------- |
19-
| Provider | `openai`, `anthropic`, `openai-codex` | How OpenClaw authenticates, discovers models, and names model refs. |
20-
| Model | `gpt-5.5`, `claude-opus-4-6` | The model selected for the agent turn. |
21-
| Agent runtime | `openclaw`, `codex`, `claude-cli` | The low level loop or backend that executes the prepared turn. |
22-
| Channel | Telegram, Discord, Slack, WhatsApp | Where messages enter and leave OpenClaw. |
17+
| Layer | Examples | What it means |
18+
| ------------- | -------------------------------------------- | ------------------------------------------------------------------- |
19+
| Provider | `openai`, `anthropic`, `openai-codex` | How OpenClaw authenticates, discovers models, and names model refs. |
20+
| Model | `gpt-5.5`, `claude-opus-4-6` | The model selected for the agent turn. |
21+
| Agent runtime | `openclaw`, `codex`, `copilot`, `claude-cli` | The low level loop or backend that executes the prepared turn. |
22+
| Channel | Telegram, Discord, Slack, WhatsApp | Where messages enter and leave OpenClaw. |
2323

2424
You will also see the word **harness** in code. A harness is the implementation
2525
that provides an agent runtime. For example, the bundled Codex harness
@@ -33,13 +33,17 @@ There are two runtime families:
3333

3434
- **Embedded harnesses** run inside OpenClaw's prepared agent loop. Today this
3535
is the built-in `openclaw` runtime plus registered plugin harnesses such as
36-
`codex`.
36+
`codex` and `copilot`.
3737
- **CLI backends** run a local CLI process while keeping the model ref
3838
canonical. For example, `anthropic/claude-opus-4-7` with
3939
a model-scoped `agentRuntime.id: "claude-cli"` means "select the Anthropic
4040
model, execute through Claude CLI." `claude-cli` is not an embedded harness id
4141
and must not be passed to AgentHarness selection.
4242

43+
The `copilot` harness is a separate, opt-in plugin harness for the
44+
GitHub Copilot CLI; see [GitHub Copilot agent runtime](/plugins/copilot)
45+
for the user-facing decision between PI, Codex, and GitHub Copilot agent runtime.
46+
4347
## Codex surfaces
4448

4549
Most confusion comes from several different surfaces sharing the Codex name:
@@ -201,6 +205,34 @@ If `openclaw doctor` warns that the `codex` plugin is enabled while
201205
`openai-codex/*` remains in config, treat that as legacy route state. Run
202206
`openclaw doctor --fix` to rewrite it to `openai/*` with the Codex runtime.
203207

208+
## GitHub Copilot agent runtime
209+
210+
The bundled `copilot` extension registers an opt-in `copilot` runtime
211+
backed by the GitHub Copilot CLI (`@github/copilot-sdk`). It claims the
212+
canonical subscription `github-copilot` provider and is **never** selected by
213+
`auto`. Opt in per-model or per-provider via `agentRuntime.id`:
214+
215+
```json5
216+
{
217+
agents: {
218+
defaults: {
219+
model: "github-copilot/gpt-5.5",
220+
models: {
221+
"github-copilot/gpt-5.5": {
222+
agentRuntime: { id: "copilot" },
223+
},
224+
},
225+
},
226+
},
227+
}
228+
```
229+
230+
The harness claims its provider, runtime, CLI session key, and auth profile
231+
prefix in `extensions/copilot/doctor-contract-api.ts`, which
232+
`openclaw doctor` auto-loads. For configuration, auth, transcript mirroring,
233+
compaction, the doctor probe surface, and the broader PI vs Codex vs Copilot
234+
SDK decision, see [GitHub Copilot agent runtime](/plugins/copilot).
235+
204236
## Compatibility contract
205237

206238
When a runtime is not OpenClaw, it should document what OpenClaw surfaces it supports.
@@ -236,6 +268,7 @@ runtime policy first. Legacy session runtime pins no longer decide routing.
236268

237269
- [Codex harness](/plugins/codex-harness)
238270
- [Codex harness runtime](/plugins/codex-harness-runtime)
271+
- [GitHub Copilot agent runtime](/plugins/copilot)
239272
- [OpenAI](/providers/openai)
240273
- [Agent harness plugins](/plugins/sdk-agent-harness)
241274
- [Agent loop](/concepts/agent-loop)

docs/concepts/models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ sidebarTitle: "Models CLI"
2323
</Card>
2424
</CardGroup>
2525

26-
Model refs choose a provider and model. They do not usually choose the low-level agent runtime. OpenAI agent refs are the main exception: `openai/gpt-5.5` runs through the Codex app-server runtime by default on the official OpenAI provider. Explicit runtime overrides belong on provider/model policy, not on the whole agent or session. In Codex runtime mode, the `openai/gpt-*` ref does not imply API-key billing; auth can come from a Codex account or `openai-codex` auth profile. See [Agent runtimes](/concepts/agent-runtimes).
26+
Model refs choose a provider and model. They do not usually choose the low-level agent runtime. OpenAI agent refs are the main exception: `openai/gpt-5.5` runs through the Codex app-server runtime by default on the official OpenAI provider. Subscription Copilot refs (`github-copilot/*`) can additionally be opted into the bundled GitHub Copilot agent runtime — that path stays explicit (no `auto` fallback). Explicit runtime overrides belong on provider/model policy, not on the whole agent or session. In Codex runtime mode, the `openai/gpt-*` ref does not imply API-key billing; auth can come from a Codex account or `openai-codex` auth profile. See [Agent runtimes](/concepts/agent-runtimes) and [GitHub Copilot agent runtime](/plugins/copilot).
2727

2828
## How model selection works
2929

0 commit comments

Comments
 (0)