Add managedSettings.clearCache RPC bindings (force-clear managed settings cache) - #2438
Add managedSettings.clearCache RPC bindings (force-clear managed settings cache)#2438joshspicer wants to merge 2 commits into
Conversation
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>
Auto-committed by java-codegen-check workflow.
🔍 Cross-SDK Consistency ReviewThis PR adds
|
❌ Automated Fix Unable to Resolve Build FailureThe agentic fix workflow analyzed the failing Root CauseThe build failure is not caused by code generation changes or handwritten SDK/test code. Instead, the failure is caused by an The CI workflow ( What Was Attempted
Why Manual Intervention Is NeededThe fix requires one of:
Both of these files are outside the scope of automated fixes in this workflow. A human maintainer needs to decide whether the JDK 25 requirement is intentional (and the workflow needs updating) or accidental (and the enforcer should be removed/relaxed). The codegen-related changes in this PR (adding Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "repo.maven.apache.org"See Network Configuration for more information.
|
What
Adds the new
managedSettings.clearCacheserver RPC method to the generated language clients (TypeScript, C#, Python, Go, Rust, Java).managedSettings.clearCacheforce-clears the enterprise managed-settings cache everywhere: it wipes the persistent on-disk cache for every account (the whole<cacheHome>/managed-settingsdirectory) and drops the 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.It is the primitive behind a host "force refresh account policy" action — the motivating use case is wiring it into VS Code's
Developer: Sync Account Policycommand so managed policy can be cleared everywhere on demand.Consumers call it via the autogenerated RPC wrapper, e.g. in Node.js:
…and the equivalent
ClearCacheAsync()(C#),clear_cache()(Python/Rust),ClearCache(ctx)(Go),clearCache()(Java).How these files were generated
These are purely generated files, produced by the repo's standard codegen pipelines:
cd nodejs && npm ci+cd scripts/codegen && npm ci && npm run generate(TS, C#, Python, Go, Rust), thencd rust && cargo +nightly-2026-04-14 fmt --all -- --config-path .rustfmt.nightly.tomlcd java/scripts/codegen && npm ci && npx tsx java.ts(Java)To isolate just this method, I ran the pipeline against the current pinned
@github/copilotschema baseline with only themanagedSettings.clearCachenode added, after first confirming a pristine regen reproduces the committed files with zero diff. So the diff here is exactly theclearCachebindings and nothing else — matching what a post-publish regen will produce.Dependency / ordering
The runtime side (the schema + server implementation) lives in github/copilot-agent-runtime (companion PR: github/copilot-agent-runtime#17809). This SDK PR is intentionally ahead of the published
@github/copilotpackage:codegen-checkCI will fail here until the@github/copilotdependency is bumped to a version that exposesmanagedSettings.clearCache(the pinned1.0.82-0baseline does not have it yet). Once the runtime change ships and the dependency is bumped,npm run generatereproduces these exact files and the check goes green.Kept as a draft until the runtime change is released.
Testing
nodejs:npm run typecheckpasses with the regeneratedrpc.ts.mcp.config.reload,runtime.shutdown), which use the same{"type":"null"}result shape.