diff --git a/CHANGELOG.md b/CHANGELOG.md index 5abbfefc..336dd374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,58 @@ All notable changes to the Copilot SDK are documented in this file. This changelog is automatically generated by an AI agent when stable releases are published. See [GitHub Releases](https://github.com/github/copilot-sdk/releases) for the full list. +## [v0.1.31](https://github.com/github/copilot-sdk/releases/tag/v0.1.31) (2026-03-07) + +### Feature: multi-client tool and permission broadcasts (protocol v3) + +The SDK now uses protocol version 3, where the runtime broadcasts `external_tool.requested` and `permission.requested` as session events to all connected clients. This enables multi-client architectures where different clients contribute different tools, or where multiple clients observe the same permission prompts — if one client approves, all clients see the result. Your existing tool and permission handler code is unchanged. ([#686](https://github.com/github/copilot-sdk/pull/686)) + +```ts +// Two clients each register different tools; the agent can use both +const session1 = await client1.createSession({ + tools: [defineTool("search", { handler: doSearch })], + onPermissionRequest: approveAll, +}); +const session2 = await client2.resumeSession(session1.id, { + tools: [defineTool("analyze", { handler: doAnalyze })], + onPermissionRequest: approveAll, +}); +``` + +```cs +var session1 = await client1.CreateSessionAsync(new SessionConfig { + Tools = [AIFunctionFactory.Create(DoSearch, "search")], + OnPermissionRequest = PermissionHandlers.ApproveAll, +}); +var session2 = await client2.ResumeSessionAsync(session1.Id, new ResumeSessionConfig { + Tools = [AIFunctionFactory.Create(DoAnalyze, "analyze")], + OnPermissionRequest = PermissionHandlers.ApproveAll, +}); +``` + +### 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](https://github.com/github/copilot-sdk/pull/631)) + +```cs +session.OnPermissionCompleted += (e) => { + if (e.Result.Kind == PermissionRequestResultKind.Approved) { /* ... */ } + if (e.Result.Kind == PermissionRequestResultKind.DeniedInteractivelyByUser) { /* ... */ } +}; +``` + +```go +// 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](https://github.com/github/copilot-sdk/pull/671)) +- improvement: **[Python]** add `timeout` parameter to generated RPC methods, allowing callers to override the default 30s timeout for long-running operations ([#681](https://github.com/github/copilot-sdk/pull/681)) +- bugfix: **[Go]** `PermissionRequest` fields are now properly typed (`ToolName`, `Diff`, `Path`, etc.) instead of a generic `Extra map[string]any` catch-all ([#685](https://github.com/github/copilot-sdk/pull/685)) + ## [v0.1.30](https://github.com/github/copilot-sdk/releases/tag/v0.1.30) (2026-03-03) ### Feature: support overriding built-in tools