Skip to content

Commit c4ccb7c

Browse files
committed
Merge branch 'main' into changelog/v0.1.32-049dc9c87af5cf41
2 parents 63b483f + 416f614 commit c4ccb7c

5 files changed

Lines changed: 1018 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,58 @@ var session = await client.CreateSessionAsync(new SessionConfig {
2525
});
2626
```
2727

28+
## [v0.1.31](https://github.com/github/copilot-sdk/releases/tag/v0.1.31) (2026-03-07)
29+
30+
### Feature: multi-client tool and permission broadcasts (protocol v3)
31+
32+
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))
33+
34+
```ts
35+
// Two clients each register different tools; the agent can use both
36+
const session1 = await client1.createSession({
37+
tools: [defineTool("search", { handler: doSearch })],
38+
onPermissionRequest: approveAll,
39+
});
40+
const session2 = await client2.resumeSession(session1.id, {
41+
tools: [defineTool("analyze", { handler: doAnalyze })],
42+
onPermissionRequest: approveAll,
43+
});
44+
```
45+
46+
```cs
47+
var session1 = await client1.CreateSessionAsync(new SessionConfig {
48+
Tools = [AIFunctionFactory.Create(DoSearch, "search")],
49+
OnPermissionRequest = PermissionHandlers.ApproveAll,
50+
});
51+
var session2 = await client2.ResumeSessionAsync(session1.Id, new ResumeSessionConfig {
52+
Tools = [AIFunctionFactory.Create(DoAnalyze, "analyze")],
53+
OnPermissionRequest = PermissionHandlers.ApproveAll,
54+
});
55+
```
56+
57+
### Feature: strongly-typed `PermissionRequestResultKind` for .NET and Go
58+
59+
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))
60+
61+
```cs
62+
session.OnPermissionCompleted += (e) => {
63+
if (e.Result.Kind == PermissionRequestResultKind.Approved) { /* ... */ }
64+
if (e.Result.Kind == PermissionRequestResultKind.DeniedInteractivelyByUser) { /* ... */ }
65+
};
66+
```
67+
68+
```go
69+
// Go: PermissionKindApproved, PermissionKindDeniedByRules,
70+
// PermissionKindDeniedCouldNotRequestFromUser, PermissionKindDeniedInteractivelyByUser
71+
if result.Kind == copilot.PermissionKindApproved { /* ... */ }
72+
```
73+
74+
### Other changes
75+
76+
- 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))
77+
- 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))
78+
- 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))
79+
2880
## [v0.1.30](https://github.com/github/copilot-sdk/releases/tag/v0.1.30) (2026-03-03)
2981

3082
### Feature: support overriding built-in tools

docs/guides/custom-agents.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const session = await client.createSession({
6565

6666
```python
6767
from copilot import CopilotClient
68+
from copilot.types import PermissionRequestResult
6869

6970
client = CopilotClient()
7071
await client.start()
@@ -87,7 +88,7 @@ session = await client.create_session({
8788
"prompt": "You are a code editor. Make minimal, surgical changes to files as requested.",
8889
},
8990
],
90-
"on_permission_request": lambda req: {"kind": "approved"},
91+
"on_permission_request": lambda req, inv: PermissionRequestResult(kind="approved"),
9192
})
9293
```
9394

0 commit comments

Comments
 (0)