Copilot SDK v0.2.1-preview.0: Commands & Blob Attachments
Node.js gets commands and UI prompts, all SDKs gain custom model listing, and blob attachments let you send images without disk writes. Go has breaking enum and struct naming changes.
TL;DR
- Node.js SDK now supports slash commands and interactive UI prompts (confirm, select, text input)
- All SDKs gain custom model listing via
onListModelscallback for BYOK setups - New blob attachment type for sending base64 image data without disk writes
- Breaking changes in Go: enum naming convention and struct name updates
New
- Commands and UI prompts for Node.js — Register slash commands and show interactive dialogs (confirm, select, text input) in sessions, bringing Node.js to feature parity with other SDKs.
- Custom model listing callback — All SDKs now accept
onListModelsin client options, letting you override model discovery for BYOK scenarios where you control the provider. - Blob attachments — Send base64-encoded images directly to sessions without writing to disk first, useful for screenshots and in-memory generated content.
- Skip permission prompts for safe tools — Tools can now set
skipPermission: trueto bypass per-use permission dialogs.
Fixed
- Node.js CommonJS compatibility — SDK can now be
require()d in VS Code extensions and other CommonJS contexts. - Node.js cliPath handling —
cliPathis now properly ignored whencliUrlis already set. - C# SessionEvent serialization — Fixed
ToJson()failing for events withJsonElement-backed members. - C# unknown session events — Unknown event types no longer throw; returned as
UnknownSessionEventpreserving raw JSON. - C# AOT serialization crash — Fixed crash when
CancellationTokenfires during JSON-RPC operations. - Go enum naming — All enum constants now use
TypeNameValueconvention (e.g.,SessionEventTypeSessionIdle). - Go struct naming — Removed
Rpcsuffix from struct names in therpcpackage. - Go Session.SetModel signature — Now takes
*SetModelOptionsinstead of variadic argument. - Python workspace_path flexibility —
workspace_pathinCopilotSessionnow accepts anyos.PathLikevalue.
Breaking Changes
- Go enum constants — Update references from unprefixed names to the new
TypeNameValueconvention (e.g.,SessionIdle→SessionEventTypeSessionIdle). - Go struct names — Remove
Rpcsuffix from struct references in therpcpackage. - Go Session.SetModel — Change variadic calls to pass
*SetModelOptionspointer instead. - Python private modules —
telemetry,jsonrpc, andsdk_protocol_versionare now marked private; don't import directly.
Update via npm install @github/copilot-sdk@0.2.1-preview.0 (Node.js), or check your language's package manager for the latest version.
Source: Copilot SDK