Skip to content

Rust: Isolate hostless runtime cache - #2659

Merged
ellismg merged 1 commit into
mainfrom
ellismg-isolate-runtime-cache
Sep 15, 2026
Merged

ellismg merged 1 commit into
mainfrom
ellismg-isolate-runtime-cache

Conversation

@ellismg

@ellismg ellismg commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

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 at cli/<version>.

This prevents stale hostless-runtime cleanup from deleting a same-version bundled copilot executable used by another application. COPILOT_CLI_EXTRACT_DIR retains its existing direct-directory semantics.

Changes

  • Share hostless runtime path computation between build.rs and runtime resolution.
  • Document the distinct cache paths on macOS, Linux, and Windows.
  • Add regression coverage proving runtime cleanup cannot delete or overwrite the bundled CLI directory.
  • Update focused non-bundled resolution tests for the new namespace.

Validation

  • rustup run nightly-2026-04-14 cargo fmt --check
  • cargo test --no-default-features --lib cache_paths::tests
  • Focused cli_resolution_test cases for conventional extraction, runtime resolution, and COPILOT_CLI_EXTRACT_DIR
  • cargo clippy --no-default-features --lib -- -D warnings
  • cargo clippy --all-features --all-targets -- -D warnings

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>
Copilot AI balanced review requested due to automatic review settings September 14, 2026 22:44
@ellismg
ellismg requested a review from a team as a code owner September 14, 2026 22:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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> to runtime/<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.

@ellismg
ellismg enabled auto-merge September 14, 2026 22:51
@ellismg

ellismg commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants