Skip to content

fix: ignore stale native runtime cache manifests - #1170

Merged
ndizazzo merged 3 commits into
mainfrom
codex/confirm-issue-1162
Aug 5, 2026
Merged

fix: ignore stale native runtime cache manifests#1170
ndizazzo merged 3 commits into
mainfrom
codex/confirm-issue-1162

Conversation

@ndizazzo

@ndizazzo ndizazzo commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes native runtime installation failing when the cache contains runtime manifests from older MeshLLM releases that predate per-file checksums.

Root cause

Resolver candidate discovery strictly validated every cached runtime before applying the requested MeshLLM version filter. A legacy cached manifest therefore aborted installation before a valid explicit bundle could be selected.

Changes

  • Add strict, version-scoped cache enumeration for resolver candidate discovery.
  • Keep full-cache inventory and explicit/current runtime checksum validation strict.
  • Add cache, resolver, and end-to-end installer regressions covering legacy manifests.
  • Mark the compatibility boundary for future cleanup once pre-checksum caches are no longer part of supported upgrade paths.

Fixes #1162

Validation

  • cargo fmt --all --check
  • cargo test -p mesh-llm-native-runtime --lib
  • cargo test -p mesh-llm-runtime-install --lib
  • cargo check -p mesh-llm-native-runtime
  • cargo check -p mesh-llm-runtime-install
  • cargo check -p mesh-llm
  • cargo clippy -p mesh-llm-native-runtime --all-targets -- -D warnings
  • cargo clippy -p mesh-llm-runtime-install --all-targets -- -D warnings
  • cargo clippy -p mesh-llm --all-targets -- -D warnings

Summary by CodeRabbit

  • Bug Fixes
    • Improved runtime selection to use only installations compatible with the requested MeshLLM version.
    • Legacy or incompatible cached runtimes no longer interfere with runtime resolution or bundle installation.
    • Added validation and consistent ordering when listing installed runtimes.
    • Files stored at version paths are now ignored when they are not valid runtime entries.
  • Tests
    • Added coverage for version-specific runtime discovery and installation with stale cache entries.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: db0c93da-17a8-4584-9527-0d65b3aa98ad

📥 Commits

Reviewing files that changed from the base of the PR and between 8eb33fd and 8ce8d8a.

📒 Files selected for processing (3)
  • crates/mesh-llm-native-runtime/src/cache.rs
  • crates/mesh-llm-native-runtime/src/resolver.rs
  • crates/mesh-llm-runtime-install/src/lib.rs
🚧 Files skipped from review as they are similar to previous changes (3)
  • crates/mesh-llm-runtime-install/src/lib.rs
  • crates/mesh-llm-native-runtime/src/resolver.rs
  • crates/mesh-llm-native-runtime/src/cache.rs

📝 Walkthrough

Walkthrough

Runtime cache enumeration now supports MeshLLM version scoping. Resolver discovery uses scoped enumeration. Regression tests confirm that legacy cached manifests do not block valid runtime installation or resolution.

Changes

Runtime cache compatibility

Layer / File(s) Summary
Version-scoped cache enumeration
crates/mesh-llm-native-runtime/src/cache.rs
NativeRuntimeCache centralizes version-directory traversal and adds installed_for_version. Enumeration validates manifests, handles missing or invalid version paths, sorts runtime IDs, and tests legacy-entry behavior.
Resolver version filtering
crates/mesh-llm-native-runtime/src/resolver.rs
Cached runtime lookup uses the resolver’s exact MeshLLM version. A regression test confirms that a legacy cached runtime is ignored.
Legacy-cache installation regression
crates/mesh-llm-runtime-install/src/lib.rs
The explicit bundle installation test covers fresh caches and caches containing incompatible legacy manifests. Both installations succeed.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • Mesh-LLM/mesh-llm#1043: Both changes modify native-runtime cache compatibility and version-specific runtime discovery.

Suggested reviewers: michaelneale, i386

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the fix for stale native runtime cache manifests.
Linked Issues check ✅ Passed The changes prevent legacy manifests from blocking valid runtime installation while preserving strict validation for current runtimes, satisfying issue #1162.
Out of Scope Changes check ✅ Passed The implementation and regression tests remain within the scope of handling stale native runtime cache manifests.
Docstring Coverage ✅ Passed Docstring coverage is 87.50% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/confirm-issue-1162

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
crates/mesh-llm-native-runtime/src/cache.rs (1)

125-127: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Restrict installed_for_version to crate visibility.

The method is used only inside mesh-llm-native-runtime; make it pub(crate) so cache enumeration stays internal to the crate.

Proposed change
-    pub fn installed_for_version(&self, mesh_version: &str) -> Result<Vec<InstalledNativeRuntime>> {
+    pub(crate) fn installed_for_version(
+        &self,
+        mesh_version: &str,
+    ) -> Result<Vec<InstalledNativeRuntime>> {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-native-runtime/src/cache.rs` around lines 125 - 127, Change
the visibility of NativeRuntimeCache::installed_for_version from pub to
pub(crate), keeping its parameters, return type, and implementation unchanged.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@crates/mesh-llm-native-runtime/src/cache.rs`:
- Around line 125-127: Change the visibility of
NativeRuntimeCache::installed_for_version from pub to pub(crate), keeping its
parameters, return type, and implementation unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2a7d7248-633c-4c31-b380-b253bb1601d4

📥 Commits

Reviewing files that changed from the base of the PR and between ad38de6 and ba21a1d.

📒 Files selected for processing (3)
  • crates/mesh-llm-native-runtime/src/cache.rs
  • crates/mesh-llm-native-runtime/src/resolver.rs
  • crates/mesh-llm-runtime-install/src/lib.rs

@ndizazzo
ndizazzo requested a review from i386 August 4, 2026 18:06
Comment thread crates/mesh-llm-native-runtime/src/cache.rs

@i386 i386 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Small thing

@ndizazzo
ndizazzo force-pushed the codex/confirm-issue-1162 branch from 29d7012 to b528124 Compare August 5, 2026 01:50
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

1 similar comment
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@ndizazzo
ndizazzo requested a review from i386 August 5, 2026 01:57
@ndizazzo
ndizazzo merged commit b7c26eb into main Aug 5, 2026
58 checks passed
@ndizazzo
ndizazzo deleted the codex/confirm-issue-1162 branch August 5, 2026 02:22
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.

runtime install aborts on pre-0.75 cached manifests

2 participants