Releases: github/copilot-sdk
v0.2.1-preview.1
Change: ephemeral events no longer included in getMessages()
Following a runtime update to 1.0.12, events like session.idle are now truly ephemeral — they are only observable via live event listeners and are not returned by session.getMessages() / get_messages(). This makes session resume behave consistently whether the session was previously active in-process or is being resumed from disk. (#927)
If your code calls getMessages() and checks for a session.idle event to determine whether a turn is complete, switch to using a live event listener instead:
session.on("session.idle", () => {
// turn is complete
});session.OnSessionIdle += (e) => {
// turn is complete
};Other changes
- improvement: [All]
COPILOT_CLI_PATHenv var is now read from the effective environment configured on the client (e.g. viaoptions.env), not just the process environment — consistent across all SDKs (#925)
Generated by Release Changelog Generator
v0.2.1-preview.0
Feature: commands and UI elicitation support for Node.js
The Node.js SDK now supports registering slash commands and prompting users with interactive dialogs. Pass commands in session config to handle CLI slash commands; use session.ui to show confirm, select, or text-input prompts. The feature was already available in other SDKs. (#906)
const session = await client.createSession({
commands: [{
name: "deploy",
handler: async (params) => ({ text: `Deploying to \$\{params.args}...` })
}]
});
const confirmed = await session.ui.confirm({ title: "Proceed?", message: "This will deploy to production." });
const env = await session.ui.select({ title: "Environment", options: [{ value: "prod" }, { value: "staging" }] });
const note = await session.ui.input({ title: "Release note" });Feature: custom model listing for BYOK mode
All four SDKs now accept an onListModels callback in client options. When provided, client.listModels() calls your handler instead of querying the CLI — useful for BYOK setups where you want to expose your provider's available models. (#730)
const client = new CopilotClient({
onListModels: async () => [{ id: "gpt-4o", displayName: "GPT-4o", vendor: "OpenAI" }]
});var client = new CopilotClient(new CopilotClientOptions {
OnListModels = async (ct) => [new ModelInfo { Id = "gpt-4o", DisplayName = "GPT-4o" }]
});- Python:
on_list_models=lambda: [ModelInfo(id="gpt-4o", display_name="GPT-4o")] - Go:
OnListModels: func(ctx context.Context) ([]copilot.ModelInfo, error) { ... }
Feature: blob attachments for inline image data
A new blob attachment type lets you send base64-encoded content directly to a session without writing it to disk first — useful when images are already in memory (screenshots, API responses, generated images). (#731)
await session.sendMessage("Describe this screenshot", {
attachments: [{ type: "blob", data: base64Data, mimeType: "image/png", displayName: "screen.png" }]
});await session.send_message("Describe this screenshot", attachments=[
BlobAttachment(type="blob", data=base64_data, mime_type="image/png", display_name="screen.png")
])Other changes
- feature: [All] tools can now set
skipPermission: trueto bypass per-use permission prompts for safe tools (#808) - bugfix: [Node] add CJS compatibility so the SDK can be
require()d in VS Code extensions and other CommonJS contexts (#546) - bugfix: [Node]
cliPathis now ignored whencliUrlis already set (#787) - bugfix: [C#] fix
SessionEvent.ToJson()failing for events withJsonElement-backed members (e.g.tool.execution_start,session.shutdown) (#868) - bugfix: [C#] unknown session event types no longer throw; they are returned as
UnknownSessionEventpreserving the raw JSON (#881) - bugfix: [C#] fix AOT serialization crash when a
CancellationTokenfires during a JSON-RPC operation (#783) - improvement: [C#] optional RPC parameters are now optional method parameters, preventing source-breaking changes when new optional params are added by the runtime (#733)
- bugfix: [Go] all enum constants are now consistently named using the
TypeNameValueconvention (e.g.SessionEventTypeSessionIdle,ModeInteractive) — breaking change: update any references using the old unprefixed names (#883) - improvement: [Go]
Rpcsuffix removed from struct names in therpcpackage (e.g.ModelRpcApi→ModelApi) (#905) - bugfix: [Go]
Session.SetModelnow takes*SetModelOptionsinstead of a variadic argument (#904) - bugfix: [Python]
workspace_pathinCopilotSessionnow accepts anyos.PathLikevalue, not just strings (#901) - improvement: [Python]
telemetry,jsonrpc, andsdk_protocol_versionmodules are now marked as private (#884)
New contributors
@darthmolenmade their first contribution in #546@MackinnonBuckmade their first contribution in #731@kirankashyapmade their first contribution in #740@PureWeenmade their first contribution in #783@stefansedichmade their first contribution in #784@sergiou87made their first contribution in #787@MRayermannMSFTmade their first contribution in #808@xoofxmade their first contribution in #868@jamesmontemagnomade their first contribution in #879@Ron537made their first contribution in #881@edburnsmade their first contribution in #889
Generated by Release Changelog Generator
v0.2.0
This is a big update with a broad round of API refinements, new capabilities, and cross-SDK consistency improvements that have shipped incrementally through preview releases since v0.1.32.
Highlights
Fine-grained system prompt customization
A new "customize" mode for systemMessage lets you surgically edit individual sections of the Copilot system prompt — without replacing the entire thing. Ten sections are configurable: identity, tone, tool_efficiency, environment_context, code_change_rules, guidelines, safety, tool_instructions, custom_instructions, and last_instructions.
Each section supports four static actions (replace, remove, append, prepend) and a transform callback that receives the current rendered content and returns modified text — useful for regex mutations, conditional edits, or logging what the prompt contains. (#816)
const session = await client.createSession({
onPermissionRequest: approveAll,
systemMessage: {
mode: "customize",
sections: {
identity: {
action: (current) => current.replace("GitHub Copilot", "Acme Assistant"),
},
tone: { action: "replace", content: "Be concise and professional." },
code_change_rules: { action: "remove" },
},
},
});var session = await client.CreateSessionAsync(new SessionConfig {
OnPermissionRequest = PermissionHandler.ApproveAll,
SystemMessage = new SystemMessageConfig {
Mode = SystemMessageMode.Customize,
Sections = new Dictionary<string, SectionOverride> {
["identity"] = new() {
Transform = current => Task.FromResult(current.Replace("GitHub Copilot", "Acme Assistant")),
},
["tone"] = new() { Action = SectionOverrideAction.Replace, Content = "Be concise and professional." },
["code_change_rules"] = new() { Action = SectionOverrideAction.Remove },
},
},
});OpenTelemetry support across all SDKs
All four SDK languages now support distributed tracing with the Copilot CLI. Set telemetry in your client options to configure an OTLP exporter; W3C trace context is automatically propagated on session.create, session.resume, and session.send, and restored in tool handlers so tool execution is linked to the originating trace. (#785)
const client = new CopilotClient({
telemetry: {
otlpEndpoint: "http://localhost:4318",
sourceName: "my-app",
},
});var client = new CopilotClient(new CopilotClientOptions {
Telemetry = new TelemetryConfig {
OtlpEndpoint = "http://localhost:4318",
SourceName = "my-app",
},
});- Python:
CopilotClient(SubprocessConfig(telemetry={"otlp_endpoint": "http://localhost:4318", "source_name": "my-app"})) - Go:
copilot.NewClient(&copilot.ClientOptions{Telemetry: &copilot.TelemetryConfig{OTLPEndpoint: "http://localhost:4318", SourceName: "my-app"}})
Blob attachments for inline binary data
A new blob attachment type lets you send images or other binary content directly to a session without writing to disk — useful when data is already in memory (screenshots, API responses, generated images). (#731)
await session.send({
prompt: "What's in this image?",
attachments: [{ type: "blob", data: base64Str, mimeType: "image/png" }],
});await session.SendAsync(new MessageOptions {
Prompt = "What's in this image?",
Attachments = [new UserMessageDataAttachmentsItemBlob { Data = base64Str, MimeType = "image/png" }],
});Pre-select a custom agent at session creation
You can now specify which custom agent should be active when a session starts, eliminating the need for a separate session.rpc.agent.select() call. (#722)
const session = await client.createSession({
customAgents: [
{ name: "researcher", prompt: "You are a research assistant." },
{ name: "editor", prompt: "You are a code editor." },
],
agent: "researcher",
onPermissionRequest: approveAll,
});var session = await client.CreateSessionAsync(new SessionConfig {
CustomAgents = [
new CustomAgentConfig { Name = "researcher", Prompt = "You are a research assistant." },
new CustomAgentConfig { Name = "editor", Prompt = "You are a code editor." },
],
Agent = "researcher",
OnPermissionRequest = PermissionHandler.ApproveAll,
});New features
skipPermissionon tool definitions — Tools can now be registered withskipPermission: trueto bypass the confirmation prompt for low-risk operations like read-only queries. Available in all four SDKs. (#808)reasoningEffortwhen switching models — All SDKs now accept an optionalreasoningEffortparameter insetModel()for models that support it. (#712)- Custom model listing for BYOK — Applications using bring-your-own-key providers can supply
onListModelsin client options to overrideclient.listModels()with their own model list. (#730) no-resultpermission outcome — Permission handlers can now return"no-result"so extensions can attach to sessions without actively answering permission requests. (#802)SessionConfig.onEventcatch-all — A newonEventhandler on session config is registered before the RPC is issued, guaranteeing that early events likesession.startare never dropped. (#664)- Node.js CJS compatibility — The Node.js SDK now ships both ESM and CJS builds, fixing crashes in VS Code extensions and other tools bundled with esbuild's
format: "cjs". No changes needed in consumer code. (#546) - Experimental API annotations — APIs marked experimental in the schema (agent, fleet, compaction groups) are now annotated in all four SDKs:
[Experimental]in C#,/** @experimental */in TypeScript, and comments in Python and Go. (#875) - System notifications and session log APIs — Updated to match the latest CLI runtime, adding
system.notificationevents and a session log RPC API. (#737)
Improvements
- [.NET, Go] Serialize event dispatch so handlers are invoked in registration order with no concurrent calls (#791)
- [Go] Detach CLI process lifespan from the context passed to
Client.Startso cancellation no longer kills the child process (#689) - [Go] Stop RPC client logging expected EOF errors (#609)
- [.NET] Emit XML doc comments from schema descriptions in generated RPC code (#724)
- [.NET] Use lazy property initialization in generated RPC classes (#725)
- [.NET] Add
DebuggerDisplayattribute toSessionEventfor easier debugging (#726) - [.NET] Optional RPC params are now represented as optional method params for forward-compatible generated code (#733)
- [.NET] Replace
Task.WhenAny+Task.Delaytimeout pattern with.WaitAsync(TimeSpan)(#805) - [.NET] Add NuGet package icon (#688)
- [Node] Don't resolve
cliPathwhencliUrlis already set (#787)
New RPC methods
We've added low-level RPC methods to control a lot more of what's going on in the session. These are emerging APIs that don't yet have friendly wrappers, and some may be flagged as experimental or subject to change.
session.rpc.skills.list(),.enable(name),.disable(name),.reload()session.rpc.mcp.list(),.enable(name),.disable(name),.reload()session.rpc.extensions.list(),.enable(name),.disable(name),.reload()session.rpc.plugins.list()session.rpc.ui.elicitation(...)— structured user inputsession.rpc.shell.exec(command),.kill(pid)session.log(message, level, ephemeral)
In an forthcoming update, we'll add friendlier wrappers for these.
Bug fixes
- [.NET] Fix
SessionEvent.ToJson()failing for events withJsonElement-backed payloads (assistant.message,tool.execution_start, etc.) (#868) - [.NET] Add fallback
TypeInfoResolverforStreamJsonRpc.RequestIdto fix NativeAOT compatibility (#783) - [.NET] Fix codegen for discriminated unions nested within other types (#736)
- [.NET] Handle unknown session event types gracefully instead of throwing (#881)
⚠️ Breaking changes
All SDKs
autoRestartremoved — TheautoRestartoption has been deprecated across all SDKs (it was never fully implemented). The property still exists but has no effect and will be removed in a future release. Remove any references toautoRestartfrom your client options. (#803)
Python
The Pyth...
v0.1.33-preview.4
Feature: fine-grained system prompt customization
A new "customize" mode for systemMessage lets you selectively override individual sections of the Copilot system prompt — without replacing the entire prompt. This sits between "append" (add to the end) and "replace" (replace everything). (#816)
Ten sections are configurable: identity, tone, tool_efficiency, environment_context, code_change_rules, guidelines, safety, tool_instructions, custom_instructions, and last_instructions.
Each section supports four static actions (replace, remove, append, prepend) and a transform action — a callback that receives the current rendered section content and returns the modified version, enabling regex mutations, logging, or conditional edits.
const session = await client.createSession({
systemMessage: {
mode: "customize",
sections: {
identity: {
// transform: read current content and return modified content
action: (current) => current.replace("GitHub Copilot", "Acme Assistant"),
},
tone: { action: "replace", content: "Be concise and professional." },
code_change_rules: { action: "remove" },
},
},
});var session = await client.CreateSessionAsync(new SessionOptions {
SystemMessage = new SystemMessageOptions {
Mode = SystemMessageMode.Customize,
Sections = new Dictionary(string, SectionOverride) {
["identity"] = new() {
Transform = current => current.Replace("GitHub Copilot", "Acme Assistant"),
},
["tone"] = new() { Action = "replace", Content = "Be concise and professional." },
["code_change_rules"] = new() { Action = "remove" },
},
},
});Generated by Release Changelog Generator
Generated by Release Changelog Generator
v0.1.33-preview.3
Feature: OpenTelemetry support across all SDKs
All four SDK languages now support distributed tracing with the Copilot CLI. Set telemetry in your client options to configure an OTLP exporter; W3C trace context is then propagated on session.create, session.resume, and session.send, and restored in tool handlers so tool execution is linked to the originating trace. (#785)
const client = new CopilotClient({
telemetry: {
otlpEndpoint: "(localhost/redacted)
sourceName: "my-app",
},
});var client = new CopilotClient(new CopilotClientOptions {
Telemetry = new TelemetryConfig {
OtlpEndpoint = "(localhost/redacted)
SourceName = "my-app",
},
});Feature: blob attachment type for inline base64 data
A new blob attachment type lets you send images or other binary content directly to a session without writing to disk first — useful when data is already in memory (screenshots, API responses, generated images). (#731)
await session.send("What's in this image?", {
attachments: [{ type: "blob", data: base64Str, mimeType: "image/png" }],
});await session.SendAsync("What's in this image?", new MessageOptions {
Attachments = [new BlobAttachment { Data = base64Str, MimeType = "image/png" }],
});Feature: Node.js CommonJS (CJS) compatibility
The Node.js SDK now ships both ESM and CJS builds, fixing crashes in VS Code extensions and other tools bundled with esbuild's format: "cjs". No changes needed in consumer code — Node automatically selects the right format. (#546)
Feature: reasoningEffort when switching models
All SDKs now accept an optional reasoningEffort parameter in setModel() for models that support it. (#712)
await session.setModel("claude-sonnet-4.6", { reasoningEffort: "high" });await session.SetModelAsync("claude-sonnet-4.6", reasoningEffort: "high");- Python:
await session.set_model("claude-sonnet-4.6", reasoning_effort="high") - Go:
session.SetModel(ctx, "claude-sonnet-4.6", &copilot.SetModelOptions{ReasoningEffort: "high"})
Feature: skipPermission flag on tool definitions
Tools can now be registered with skipPermission: true (or SkipPermission in .NET) to bypass the permission confirmation step for low-risk tools such as read-only queries. (#808)
session.defineTool("query_db", { skipPermission: true }, async (params) => {
// read-only, no permission prompt
});session.DefineTool("query_db", new ToolOptions { SkipPermission = true }, async (params) => {
// read-only, no permission prompt
});Feature: experimental API annotations
APIs marked experimental in the schema (agent, fleet, and compaction groups) are now annotated in all four SDK languages: [Experimental] in C#, /** @experimental */ in TypeScript, and comments in Python and Go. Experimental APIs will continue to evolve. (#875)
Other changes
- feature: [Python]
CopilotClientconstructor now accepts typed config objects instead of individual keyword arguments (#793) - feature: [Python] updated
CopilotSession.send()andsend_and_wait()signatures for cleaner API surface (#814) - feature: [Python] add typed overloads for
CopilotClient.on()event registration (#589) - improvement: [.NET, Go] serialize event dispatch so handlers are invoked in registration order with no concurrent calls (#791)
- improvement: [Go] detach CLI process lifespan from the context passed to
Client.Startso cancellation no longer kills the child process (#689) - improvement: [Go]
LogOptions.Ephemeralchanged fromboolto*boolfor proper three-state semantics; usecopilot.Bool(true)(#827) - improvement: [Go] stop RPC client logging expected EOF errors (#609)
- bugfix: [C#] fix
SessionEvent.ToJson()failing for events withJsonElement-backed payloads (assistant.message,tool.execution_start, etc.) (#868) - bugfix: [.NET] add fallback
TypeInfoResolverforStreamJsonRpc.RequestIdto fix NativeAOT compatibility (#783) - improvement: [.NET] replace
Task.WhenAny+Task.Delaytimeout pattern with.WaitAsync(TimeSpan)(#805) - improvement: remove
autoRestartoption across all SDKs (was never fully implemented; APIs are now marked obsolete and will be removed soon) (#803)
New contributors
@darthmolenmade their first contribution in #546@MackinnonBuckmade their first contribution in #731@PureWeenmade their first contribution in #783@stefansedichmade their first contribution in #784@MRayermannMSFTmade their first contribution in #808@xoofxmade their first contribution in #868@jamesmontemagnomade their first contribution in #879@edburnsmade their first contribution in #889
Generated by Release Changelog Generator
Generated by Release Changelog Generator
v0.1.33-preview.0
Feature: pre-select a custom agent at session creation
You can now specify which custom agent should be active when a session starts, without needing a separate session.rpc.agent.select() call. (#722)
const session = await client.createSession({
customAgents: [
{ name: "researcher", prompt: "You are a research assistant." },
{ name: "editor", prompt: "You are a code editor." },
],
agent: "researcher", // active agent at session start
onPermissionRequest: approveAll,
});var session = await client.CreateSessionAsync(new SessionConfig {
CustomAgents = [
new CustomAgentConfig { Name = "researcher", Prompt = "You are a research assistant." },
new CustomAgentConfig { Name = "editor", Prompt = "You are a code editor." },
],
Agent = "researcher", // active agent at session start
});Feature: custom model listing for BYOK
Applications using bring-your-own-key providers can now supply onListModels in client options to override client.listModels() with their own model list, instead of forwarding the call to the CLI. (#730)
const client = new CopilotClient({ onListModels: () => myProviderModels });var client = new CopilotClient(new CopilotClientOptions {
OnListModels = () => Task.FromResult(myProviderModels)
});- Python:
on_list_models=lambda: my_provider_models - Go:
OnListModels: func(ctx context.Context) ([]copilot.ModelInfo, error) { return myModels, nil }
Feature: new events and APIs (system notifications, session log, extension support)
Updated to match the latest CLI runtime, adding: system.notification events, a session log RPC API, reasoningEffort changes after model switch, alreadyInUse flag on sessions, and the groundwork for extension-based integrations. (#737)
Other changes
- feature: add
no-resultpermission outcome so extensions can attach to sessions without actively answering permission requests (#802) - bugfix: fix race condition where events emitted during session creation (e.g.
session.start) could be dropped; also addsOnEventcatch-all handler toSessionConfig(#664) - improvement: [C#] optional RPC params are now represented as optional C# method params for forward-compatible generated code (#733)
- bugfix: [C#] fix codegen for discriminated unions nested within other types (#736)
- improvement: [C#] emit XML doc comments from schema descriptions in generated RPC code (#724)
- improvement: [C#] use lazy property initialization in generated RPC classes (#725)
- improvement: [C#] add
DebuggerDisplayattribute toSessionEventfor easier debugging (#726) - improvement: [.NET] add NuGet package icon (#688)
- bugfix: [Node] don't resolve
cliPathwhencliUrlis already set (#787)
New contributors
@sergiou87made their first contribution in #787@kirankashyapmade their first contribution in #740
Generated by Release Changelog Generator
Generated by Release Changelog Generator
v0.1.32
Feature: backward compatibility with v2 CLI servers
SDK applications written against the v3 API now also work when connected to a v2 CLI server, with no code changes required.
Generated by Release Changelog Generator
Generated by Release Changelog Generator
v0.1.31
Feature: strongly-typed PermissionRequestResultKind for .NET and Go
Rather than comparing result.Kind against undiscoverable magic strings like "approved" or "denied-interactively-by-user", .NET and Go now provide typed constants. Node and Python already had typed unions for this; this brings full parity. (#631)
session.OnPermissionCompleted += (e) => {
if (e.Result.Kind == PermissionRequestResultKind.Approved) { /* ... */ }
if (e.Result.Kind == PermissionRequestResultKind.DeniedInteractivelyByUser) { /* ... */ }
};// Go: PermissionKindApproved, PermissionKindDeniedByRules,
// PermissionKindDeniedCouldNotRequestFromUser, PermissionKindDeniedInteractivelyByUser
if result.Kind == copilot.PermissionKindApproved { /* ... */ }Other changes
- feature: [Python] [Go] add
get_last_session_id()/GetLastSessionID()for SDK-wide parity (was already available in Node and .NET) (#671) - improvement: [Python] add
timeoutparameter to generated RPC methods, allowing callers to override the default 30s timeout for long-running operations (#681) - bugfix: [Go]
PermissionRequestfields are now properly typed (ToolName,Diff,Path, etc.) instead of a genericExtra map[string]anycatch-all (#685)
Generated by Release Changelog Generator
v0.1.30
Feature: support overriding built-in tools
Applications can now override built-in tools such as grep, edit_file, or read_file. To do this, register a custom tool with the same name and set the override flag. Without the flag, the runtime will return an error if the name clashes with a built-in. (#636)
import { defineTool } from "`@github/copilot-sdk`";
const session = await client.createSession({
tools: [defineTool("grep", {
overridesBuiltInTool: true,
handler: async (params) => `CUSTOM_GREP_RESULT: \$\{params.query}`,
})],
onPermissionRequest: approveAll,
});var grep = AIFunctionFactory.Create(
([Description("Search query")] string query) => $"CUSTOM_GREP_RESULT: {query}",
"grep",
"Custom grep implementation",
new AIFunctionFactoryOptions
{
AdditionalProperties = new ReadOnlyDictionary(string, object?)(
new Dictionary(string, object?) { ["is_override"] = true })
});Feature: simpler API for changing model mid-session
While session.rpc.model.switchTo() already worked, there is now a convenience method directly on the session object. (#621)
- TypeScript:
await session.setModel("gpt-4.1") - C#:
await session.SetModelAsync("gpt-4.1") - Python:
await session.set_model("gpt-4.1") - Go:
err := session.SetModel(ctx, "gpt-4.1")
Other changes
- improvement: [C#] use event delegate for thread-safe, insertion-ordered event handler dispatch (#624)
- improvement: [C#] deduplicate
OnDisposeCalland improve implementation (#626) - improvement: [C#] remove unnecessary
SemaphoreSlimlocks for handler fields (#625) - bugfix: [Python] correct
PermissionHandler.approve_alltype annotations (#618)
New contributors
@giulio-leonemade their first contribution in #618
Generated by Release Changelog Generator
Generated by Release Changelog Generator
v0.1.29
v0.1.29 (2026-02-27)
Changes
- bugfix: [Python]
CopilotClient.stop()now raises anExceptionGroupinstead of silently returning a list of exceptions (#603)
Generated by Release Changelog Generator