Skip to content

Commit 3bd902e

Browse files
committed
Merge origin/main into jmoseley-fix-node-session-disconnect
Resolve the Node client conflict by preserving session disconnect routing cleanup alongside managed permission settings from main. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 69723dd2-e732-43c6-9f9a-a16c2de3a628
2 parents a4fdef7 + 8d0a9cc commit 3bd902e

93 files changed

Lines changed: 5131 additions & 465 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,43 @@ All notable changes to the Copilot SDK are documented in this file.
55
This changelog is automatically generated by an AI agent when stable releases are published.
66
See [GitHub Releases](https://github.com/github/copilot-sdk/releases) for the full list.
77

8+
## [Unreleased]
9+
10+
### Feature: host-injected managed settings permissions
11+
12+
Session create and resume accept a new optional `managedSettings` option that injects an enterprise permissions policy at session startup, alongside the existing `enableManagedSettings` self-fetch flag. The current contract is permissions-only: `disableBypassPermissionsMode` (the literal `"disable"`), plus `deny`, `ask`, and `allow` rule lists. The layer composes restrictively with any server- or device-level managed settings (deny/ask are unioned, every present allow list must admit a tool, and `disableBypassPermissionsMode` is deny-wins).
13+
14+
This layer is startup-only and is not persisted with the session, so it must be re-supplied on resume to remain in effect; omitting it on resume clears the previously injected layer. It can be combined with `enableManagedSettings`. Host injection requires Copilot CLI `1.0.79-5` or later and does not require an SDK protocol version bump.
15+
16+
The generated session-event types also expose truthful injected-policy provenance: `session.managed_settings_resolved` can report `source` as `client` or `mixed`, with optional `clientManaged` metadata.
17+
18+
```ts
19+
const session = await client.createSession({
20+
managedSettings: {
21+
permissions: {
22+
disableBypassPermissionsMode: "disable",
23+
deny: ["shell(rm*)"],
24+
ask: ["write"],
25+
},
26+
},
27+
});
28+
```
29+
30+
```cs
31+
var session = await client.CreateSessionAsync(new SessionConfig
32+
{
33+
ManagedSettings = new ManagedSettings
34+
{
35+
Permissions = new ManagedSettingsPermissions
36+
{
37+
DisableBypassPermissionsMode = DisableBypassPermissionsMode.Disable,
38+
Deny = ["shell(rm*)"],
39+
Ask = ["write"],
40+
},
41+
},
42+
});
43+
```
44+
845
## [v1.0.7](https://github.com/github/copilot-sdk/releases/tag/v1.0.7) (2026-07-16)
946

1047
### Feature: in-process (FFI) transport

dotnet/src/Client.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ private CopilotSession InitializeSession(
785785
session.RegisterTools(config.Tools ?? []);
786786
session.RegisterPermissionHandler(
787787
config.OnPermissionRequest,
788-
config.EnableManagedSettings is true);
788+
config.EnableManagedSettings is true || config.ManagedSettings is not null);
789789
session.RegisterMcpAuthHandler(config.OnMcpAuthRequest);
790790
session.RegisterCommands(config.Commands);
791791
session.RegisterElicitationHandler(config.OnElicitationRequest);
@@ -1205,6 +1205,7 @@ public async Task<CopilotSession> CreateSessionAsync(SessionConfig config, Cance
12051205
ExpAssignments: config.ExpAssignments,
12061206
EnableManagedSettings: config.EnableManagedSettings,
12071207
GitHubMcpToolConfig: config.GitHubMcpToolConfig,
1208+
ManagedSettings: config.ManagedSettings,
12081209
EnableGitHubTelemetryForwarding: _options.OnGitHubTelemetry != null ? true : null,
12091210
AdditionalDirectories: config.AdditionalDirectories);
12101211

@@ -1425,6 +1426,7 @@ public async Task<CopilotSession> ResumeSessionAsync(string sessionId, ResumeSes
14251426
ExpAssignments: config.ExpAssignments,
14261427
EnableManagedSettings: config.EnableManagedSettings,
14271428
GitHubMcpToolConfig: config.GitHubMcpToolConfig,
1429+
ManagedSettings: config.ManagedSettings,
14281430
EnableGitHubTelemetryForwarding: _options.OnGitHubTelemetry != null ? true : null,
14291431
AdditionalDirectories: config.AdditionalDirectories);
14301432

@@ -2781,6 +2783,7 @@ internal record CreateSessionRequest(
27812783
OptionsUpdateToolFilterPrecedence? ToolFilterPrecedence = null,
27822784
[property: JsonPropertyName("expAssignments")] CopilotExpAssignmentResponse? ExpAssignments = null,
27832785
[property: JsonPropertyName("enableManagedSettings")] bool? EnableManagedSettings = null,
2786+
[property: JsonPropertyName("managedSettings")] ManagedSettings? ManagedSettings = null,
27842787
bool? EnableGitHubTelemetryForwarding = null,
27852788
[property: JsonPropertyName("githubMcpToolConfig")] GitHubMcpToolConfig? GitHubMcpToolConfig = null,
27862789
IList<string>? AdditionalDirectories = null);
@@ -2895,6 +2898,7 @@ internal record ResumeSessionRequest(
28952898
OptionsUpdateToolFilterPrecedence? ToolFilterPrecedence = null,
28962899
[property: JsonPropertyName("expAssignments")] CopilotExpAssignmentResponse? ExpAssignments = null,
28972900
[property: JsonPropertyName("enableManagedSettings")] bool? EnableManagedSettings = null,
2901+
[property: JsonPropertyName("managedSettings")] ManagedSettings? ManagedSettings = null,
28982902
bool? EnableGitHubTelemetryForwarding = null,
28992903
[property: JsonPropertyName("githubMcpToolConfig")] GitHubMcpToolConfig? GitHubMcpToolConfig = null,
29002904
IList<string>? AdditionalDirectories = null);

0 commit comments

Comments
 (0)