Rust: Isolate hostless runtime cache - #2659
Conversation
Use a dedicated runtime/<version> namespace for non-bundled in-process extraction while preserving direct COPILOT_CLI_EXTRACT_DIR semantics. Share path computation between build-time extraction and runtime resolution, and cover stale runtime cleanup without touching bundled CLI assets. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The shared path logic consistently isolates runtime cleanup while preserving custom extraction-directory behavior.
Review tier: Balanced
Findings: None
What changed in this PR
Separates Rust hostless runtime artifacts from bundled CLI cache entries to prevent destructive cleanup collisions.
Changes:
- Introduces shared runtime cache-path computation.
- Moves non-bundled artifacts from
cli/<version>toruntime/<version>. - Adds regression coverage and documents platform paths.
| File | Description |
|---|---|
rust/src/cache_paths.rs |
Centralizes cache-path logic and isolation tests. |
rust/build/in_process.rs |
Uses the runtime-specific cache path. |
rust/src/resolve.rs |
Resolves extracted runtimes through shared logic. |
rust/src/lib.rs |
Registers the cache-path module. |
rust/tests/cli_resolution_test.rs |
Updates expected extraction location. |
rust/README.md |
Documents distinct cache namespaces. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
This will be helpful for us on the copilot app team. Right now we can run into an issue without this fix which causes the CLI we use as part of our dev builds when runing out of main to get deleted and replaced with an incompatible version, breaking things until we restart the dev version of the app and redownload the correct version. |
Overview
Separate the non-bundled hostless runtime cache from the bundled CLI cache. Non-bundled in-process builds now extract to
<platform cache>/github-copilot-sdk/runtime/<version>, while bundled CLI extraction remains atcli/<version>.This prevents stale hostless-runtime cleanup from deleting a same-version bundled
copilotexecutable used by another application.COPILOT_CLI_EXTRACT_DIRretains its existing direct-directory semantics.Changes
build.rsand runtime resolution.Validation
rustup run nightly-2026-04-14 cargo fmt --checkcargo test --no-default-features --lib cache_paths::testscli_resolution_testcases for conventional extraction, runtime resolution, andCOPILOT_CLI_EXTRACT_DIRcargo clippy --no-default-features --lib -- -D warningscargo clippy --all-features --all-targets -- -D warnings