Skip to content

Commit 87a2d11

Browse files
joshspicerCopilot
andcommitted
chore(agent-host): drop local managedSettings shim for published SDK type
Remove the temporary ICopilotManagedSettingsSdk mirror and return a plain ResumeSessionConfig from _buildSessionConfig. The SDK #2139 generated types add `managedSettings` to the session config, so VS Code no longer needs a local additive type to forward enterprise-policy-derived permissions. The conditional `managedSettings` spread is unchanged: it compiles today (spread properties skip excess-property checks) and gains full static type safety once the refreshed @github/copilot-sdk carrying #2139 is picked up on rebase. No caller reads config.managedSettings, so narrowing the return type is safe. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c111c62a-eff3-4ff6-bb8a-8436a1b4babe
1 parent cd28635 commit 87a2d11

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,6 @@ type McpAuthContext = Parameters<McpAuthHandler>[1];
8282
type McpAuthResponse = Awaited<ReturnType<McpAuthHandler>>;
8383
type PreToolUseHookInput = Parameters<NonNullable<SessionHooks['onPreToolUse']>>[0];
8484
type PostToolUseHookInput = Parameters<NonNullable<SessionHooks['onPostToolUse']>>[0];
85-
/**
86-
* Local mirror of the SDK's `managedSettings` session-config field, scoped to
87-
* the `permissions` object VS Code populates. The currently published SDK
88-
* exposes `enableManagedSettings` but not `managedSettings`; this precise
89-
* additive type lets VS Code forward enterprise-policy-derived permissions
90-
* until the SDK publishes the field.
91-
* Mirrors the local-type precedent used for `ICopilotRuntimeManagedSettingsSdk`
92-
* in copilotAgent.ts.
93-
*/
94-
interface ICopilotManagedSettingsSdk {
95-
readonly permissions?: IManagedPermissions;
96-
}
9785

9886
/**
9987
* Immutable snapshot of the active client's structural contributions at
@@ -594,7 +582,7 @@ export class CopilotSessionLauncher implements ICopilotSessionLauncher {
594582
}
595583
}
596584

597-
private async _buildSessionConfig(plan: CopilotSessionLaunchPlan, runtime: ICopilotSessionRuntime): Promise<ResumeSessionConfig & { managedSettings?: ICopilotManagedSettingsSdk }> {
585+
private async _buildSessionConfig(plan: CopilotSessionLaunchPlan, runtime: ICopilotSessionRuntime): Promise<ResumeSessionConfig> {
598586
const plugins = plan.snapshot.plugins;
599587
// Synthesize BYOK provider/model config (empty when BYOK is gated off or the
600588
// renderer reports no BYOK models), merged into the returned config so both

0 commit comments

Comments
 (0)