Skip to main content

Module copilot_sdk

Module copilot_sdk 

Source
Expand description

The Copilot SDK provider — GitHub’s Rust runtime over stdio GitHub Copilot through its Rust SDK.

CopilotSdkRunner drives the same Rust runtime that copilot --acp wraps, minus the JS adapter in between. The SDK spawns the ~400 KB copilot-runtime wrapper (--server --stdio), which loads runtime.node; there is no Node process anywhere on this path.

Why a session per turn: the host owns the conversation (history arrives on every ChatRequest), so a session carries nothing worth keeping between calls, and a fresh one guarantees a request never sees another tenant’s context. Prior turns are rendered into the prompt the same way the ACP provider renders them (render_turn); the system prompt goes through the runtime’s own system slot (system_message in replace mode), which the ACP adapter has no honoured field for.

What this path reports that ACP cannot: the model that actually served (assistant.usage.model), cache read/write counts per call, and tool executions with their name, arguments and result.

Structs§

CopilotSdkRunner
GitHub Copilot through github-copilot-sdk over stdio.