Fix native runtime startup initialization - #869
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughConverts the dynamic native runtime loader from synchronous execution (with manual Tokio current-thread runtime construction) to async/await. ChangesAsync Native Runtime Loading Path
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
MeshLLM can now install or load the dynamic native runtime from inside the existing async process runtime without panicking, and CLI-only commands no longer preload host runtime state before dispatch.
This fixes the root cause behind the release smoke panic:
Details
block_on.mesh-llmCLI subcommands before startup native-runtime initialization, so commands likemesh-llm runtime installdo not first trigger implicit startup install/load behavior.Why CI missed this
The failing path was a cache-miss startup/install path under the
dynamic-native-runtimerelease feature. The problematic code only panicked when it needed to run the async installer from inside the already-runningmesh-llmTokio runtime. A compatible cache hit skips that installer and would not expose the bug.The release smoke hit this exact shape by staging a release binary and invoking native runtime installation in an isolated release workflow environment. Existing PR checks compile the dynamic runtime feature, but they did not assert the shipped binary can run
runtime installor perform startup native-runtime install from an empty cache under the release smoke layout.A follow-up CI hardening would be an isolated-cache smoke step that runs
mesh-llm runtime install --bundle-dir ... --cache-dir $(mktemp -d)and a startup load/install check withMESH_LLM_NATIVE_RUNTIME_CACHE_DIRpointed at an empty directory.Validation
cargo test -p mesh-llm-host-runtime --features dynamic-native-runtime --lib native_runtimecargo check -p mesh-llm --bin mesh-llm --features dynamic-native-runtimecargo clippy -p mesh-llm --bin mesh-llm --features dynamic-native-runtime --all-targets -- -D warningscargo check -p mesh-llm --bin mesh-llmrustfmt --edition 2024 --check crates/mesh-llm/src/lib.rs crates/mesh-llm-host-runtime/src/lib.rs crates/mesh-llm-host-runtime/src/system/native_runtime.rsgit diff --checkSummary by CodeRabbit