From f57dc91a19a5f423aa0d971ffbd75e50471296dd Mon Sep 17 00:00:00 2001 From: joshspicer Date: Fri, 28 Aug 2026 19:55:07 +0000 Subject: [PATCH 1/2] Regenerate RPC bindings for managedSettings.clearCache Adds the `managedSettings.clearCache` server RPC method across all generated language clients (TypeScript, C#, Python, Go, Rust, Java). `managedSettings.clearCache` wipes the persistent enterprise managed-settings cache for every account and drops the runtime process's in-memory retained server policy, so the next managed-settings read re-fetches from the network. It is the primitive behind a host "force refresh account policy" action (e.g. VS Code's `Developer: Sync Account Policy`). Consumers call it via the autogenerated RPC wrapper, e.g. in Node.js: await client.rpc.managedSettings.clearCache(); These files were produced by the standard codegen pipeline (`scripts/codegen` + `java/scripts/codegen`) run against the current pinned `@github/copilot` schema baseline with the new method added, so they match what a post-publish regen will produce. The runtime side lives in github/copilot-agent-runtime; once that ships and the `@github/copilot` dependency is bumped to a version exposing `managedSettings.clearCache`, `codegen-check` reproduces these files exactly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- dotnet/src/Generated/Rpc.cs | 7 +++++ go/rpc/zrpc.go | 27 +++++++++++++++++++ .../rpc/ServerManagedSettingsApi.java | 11 ++++++++ nodejs/src/generated/rpc.ts | 5 ++++ python/copilot/generated/rpc.py | 4 +++ rust/src/generated/api_types.rs | 2 ++ rust/src/generated/rpc.rs | 20 ++++++++++++++ 7 files changed, 76 insertions(+) diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index f3c1a57e6e..f13c3871bb 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -30424,6 +30424,13 @@ public async Task ReadAsync(CancellationToken cancell { return await CopilotClient.InvokeRpcAsync(_rpc, "managedSettings.read", [], cancellationToken); } + + /// Wipes the persistent enterprise managed-settings cache for every account (the whole `<cacheHome>/managed-settings` directory) and drops this runtime process's in-memory retained server policy, so the next managed-settings read for any account re-fetches from the network instead of serving a cached response. Mirrors the cache invalidation a sign-out performs, but across all accounts rather than just the one signing out — the primitive behind a host "sync account policy" / "force refresh policy" action. Device/MDM-scoped layers describe the machine, not the account, so they are left untouched. Best-effort: a disabled or already-absent cache is a no-op. + /// The to monitor for cancellation requests. The default is . + public async Task ClearCacheAsync(CancellationToken cancellationToken = default) + { + await CopilotClient.InvokeRpcAsync(_rpc, "managedSettings.clearCache", [], cancellationToken); + } } /// Provides server-scoped Runtime APIs. diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index edd5f925fe..4c2d535d21 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -4679,6 +4679,11 @@ type LspInitializeRequest struct { WorkingDirectory *string `json:"workingDirectory,omitempty"` } +// Experimental: ManagedSettingsClearCacheResult is part of an experimental API and may +// change or be removed. +type ManagedSettingsClearCacheResult struct { +} + // Validated device-managed settings discovered before a session exists. // Experimental: ManagedSettingsReadResult is part of an experimental API and may change or // be removed. @@ -19401,6 +19406,28 @@ func (a *ServerLlmInferenceAPI) SetProvider(ctx context.Context) (*LlmInferenceS // removed. type ServerManagedSettingsAPI serverAPI +// ClearCache wipes the persistent enterprise managed-settings cache for every account (the +// whole `/managed-settings` directory) and drops this runtime process's +// in-memory retained server policy, so the next managed-settings read for any account +// re-fetches from the network instead of serving a cached response. Mirrors the cache +// invalidation a sign-out performs, but across all accounts rather than just the one +// signing out — the primitive behind a host "sync account policy" / "force refresh policy" +// action. Device/MDM-scoped layers describe the machine, not the account, so they are left +// untouched. Best-effort: a disabled or already-absent cache is a no-op. +// +// RPC method: managedSettings.clearCache. +func (a *ServerManagedSettingsAPI) ClearCache(ctx context.Context) (*ManagedSettingsClearCacheResult, error) { + raw, err := a.client.Request(ctx, "managedSettings.clearCache", nil) + if err != nil { + return nil, err + } + var result ManagedSettingsClearCacheResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // Read discovers device-managed settings from production MDM and managed-file sources, // validates them against the runtime-owned managed-settings schema, and returns the // canonical JSON without requiring a session. diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java index e85b7b987a..e6013c870d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java @@ -37,4 +37,15 @@ public CompletableFuture read() { return caller.invoke("managedSettings.read", java.util.Map.of(), ManagedSettingsReadResult.class); } + /** + * Invokes {@code managedSettings.clearCache}. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture clearCache() { + return caller.invoke("managedSettings.clearCache", java.util.Map.of(), Void.class); + } + } diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index db0ea63dcc..5428b38769 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -23231,6 +23231,11 @@ export function createServerRpc(connection: MessageConnection) { */ read: async (): Promise => connection.sendRequest("managedSettings.read", {}), + /** + * Wipes the persistent enterprise managed-settings cache for every account (the whole `/managed-settings` directory) and drops this runtime process's in-memory retained server policy, so the next managed-settings read for any account re-fetches from the network instead of serving a cached response. Mirrors the cache invalidation a sign-out performs, but across all accounts rather than just the one signing out — the primitive behind a host "sync account policy" / "force refresh policy" action. Device/MDM-scoped layers describe the machine, not the account, so they are left untouched. Best-effort: a disabled or already-absent cache is a no-op. + */ + clearCache: async (): Promise => + connection.sendRequest("managedSettings.clearCache", {}), }, /** @experimental */ runtime: { diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 1d59a55f4a..d40ec8e523 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -39399,6 +39399,10 @@ async def read(self, *, timeout: float | None = None) -> ManagedSettingsReadResu "Discovers device-managed settings from production MDM and managed-file sources, validates them against the runtime-owned managed-settings schema, and returns the canonical JSON without requiring a session.\n\nReturns:\n Validated device-managed settings discovered before a session exists." return ManagedSettingsReadResult.from_dict(await self._client.request("managedSettings.read", {}, **_timeout_kwargs(timeout))) + async def clear_cache(self, *, timeout: float | None = None) -> None: + "Wipes the persistent enterprise managed-settings cache for every account (the whole `/managed-settings` directory) and drops this runtime process's in-memory retained server policy, so the next managed-settings read for any account re-fetches from the network instead of serving a cached response. Mirrors the cache invalidation a sign-out performs, but across all accounts rather than just the one signing out — the primitive behind a host \"sync account policy\" / \"force refresh policy\" action. Device/MDM-scoped layers describe the machine, not the account, so they are left untouched. Best-effort: a disabled or already-absent cache is a no-op." + await self._client.request("managedSettings.clearCache", {}, **_timeout_kwargs(timeout)) + # Experimental: this API group is experimental and may change or be removed. class ServerRuntimeApi: diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index e22c888f23..740634883d 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -121,6 +121,8 @@ pub mod rpc_methods { pub const USER_SETTINGS_SET: &str = "user.settings.set"; /// `managedSettings.read` pub const MANAGEDSETTINGS_READ: &str = "managedSettings.read"; + /// `managedSettings.clearCache` + pub const MANAGEDSETTINGS_CLEARCACHE: &str = "managedSettings.clearCache"; /// `runtime.shutdown` pub const RUNTIME_SHUTDOWN: &str = "runtime.shutdown"; /// `sessionFs.setProvider` diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 4d5b7f1538..01ad6bd910 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -859,6 +859,26 @@ impl<'a> ClientRpcManagedSettings<'a> { .await?; Ok(serde_json::from_value(_value)?) } + + /// Wipes the persistent enterprise managed-settings cache for every account (the whole `/managed-settings` directory) and drops this runtime process's in-memory retained server policy, so the next managed-settings read for any account re-fetches from the network instead of serving a cached response. Mirrors the cache invalidation a sign-out performs, but across all accounts rather than just the one signing out — the primitive behind a host "sync account policy" / "force refresh policy" action. Device/MDM-scoped layers describe the machine, not the account, so they are left untouched. Best-effort: a disabled or already-absent cache is a no-op. + /// + /// Wire method: `managedSettings.clearCache`. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn clear_cache(&self) -> Result<(), Error> { + let wire_params = serde_json::json!({}); + let _value = self + .client + .call(rpc_methods::MANAGEDSETTINGS_CLEARCACHE, Some(wire_params)) + .await?; + Ok(()) + } } /// `mcp.*` RPCs. From 7947421ae281659550d2bec4fefc569cd7cc49d4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Aug 2026 19:55:56 +0000 Subject: [PATCH 2/2] Regenerate Java codegen output Auto-committed by java-codegen-check workflow. --- .../generated/rpc/ServerManagedSettingsApi.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java index e6013c870d..e85b7b987a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java @@ -37,15 +37,4 @@ public CompletableFuture read() { return caller.invoke("managedSettings.read", java.util.Map.of(), ManagedSettingsReadResult.class); } - /** - * Invokes {@code managedSettings.clearCache}. - * - * @apiNote This method is experimental and may change in a future version. - * @since 1.0.0 - */ - @CopilotExperimental - public CompletableFuture clearCache() { - return caller.invoke("managedSettings.clearCache", java.util.Map.of(), Void.class); - } - }