Skip to content

Commit 18ffce7

Browse files
committed
AHP: opt into SDK managed-settings self-fetch
Pass selfFetchManagedSettings:true in session.create params so the runtime self-fetches enterprise bypass-permissions policy from the GitHub managed_settings endpoint at session bootstrap. The runtime enforces the result fail-closed before the first turn. Requires: github/copilot-agent-runtime#agents/managed-settings-sdk-capability
1 parent c04d3b4 commit 18ffce7

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ type PostToolUseHookInput = Parameters<NonNullable<SessionHooks['onPostToolUse']
5858
type CopilotSessionLaunchConfig = ResumeSessionConfig & {
5959
readonly pluginDirectories?: string[];
6060
readonly remoteSession?: 'export';
61+
/**
62+
* Opt the runtime into self-fetching enterprise managed settings at session
63+
* bootstrap. Declared locally until the published `@github/copilot-sdk` carries
64+
* it on `SessionConfigBase`; it is forwarded to `createSession` and read by the
65+
* runtime at runtime regardless of the published SDK's static type.
66+
*/
67+
readonly selfFetchManagedSettings?: boolean;
6168
};
6269

6370
/**
@@ -410,6 +417,12 @@ export class CopilotSessionLauncher implements ICopilotSessionLauncher {
410417
// session must opt in via `remoteSession` to actually export
411418
// events. Without this, sessions default to "off".
412419
remoteSession: this._configurationService.getRootValue(platformRootSchema, AgentHostSessionSyncEnabledConfigKey) === true ? 'export' : undefined,
420+
// Opt the runtime into self-fetching enterprise managed settings
421+
// (bypass-permissions policy) at session bootstrap. The runtime uses
422+
// the session's gitHubToken to call /copilot_internal/managed_settings
423+
// and enforces the result fail-closed before the first turn.
424+
// Typed locally on CopilotSessionLaunchConfig pending the SDK type update.
425+
selfFetchManagedSettings: true,
413426
};
414427
}
415428
}

0 commit comments

Comments
 (0)