diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index f3c1a57e6..f13c3871b 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 edd5f925f..4c2d535d2 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/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index db0ea63dc..5428b3876 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 1d59a55f4..d40ec8e52 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 e22c888f2..740634883 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 4d5b7f153..01ad6bd91 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.