Skip to content

chore: improve embedded native-runtime compatibility guidance - #1043

Merged
ndizazzo merged 3 commits into
mainfrom
codex/issue-1016-sdk-runtime-guidance
Jul 26, 2026
Merged

chore: improve embedded native-runtime compatibility guidance#1043
ndizazzo merged 3 commits into
mainfrom
codex/issue-1016-sdk-runtime-guidance

Conversation

@ndizazzo

@ndizazzo ndizazzo commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Closes #1016

What changed

  • document the exact SDK release and Skippy ABI compatibility check before embedded serving
  • expose the host-runtime initializer through the serving SDK surface
  • preflight embedded serve startup against compatible cached native runtimes without implicit downloads
  • return an actionable error containing the required versions, cache location, and install API
  • add tests for the documented check/install/initialize/start flow and missing-runtime error path

Why

Embedded SDK users could previously reach a low-level FFI failure when the process had no compatible native runtime loaded. The shipped binary performs native-runtime loading during startup, but embedded serving did not make that prerequisite clear or fail early with corrective guidance.

Validation

  • focused runtime-install, host-runtime, and SDK tests
  • focused cargo check and warning-denying Clippy checks
  • cargo fmt --all --check
  • just test-all

Summary by CodeRabbit

  • New Features
    • Embedded serving now performs a native-runtime compatibility check during startup (when the dynamic-native-runtime option is enabled) and fails fast if requirements aren’t met.
    • Added/expanded public SDK APIs to initialize the embedded host runtime and to verify exact MeshLLM version + Skippy ABI compatibility.
  • Bug Fixes
    • Startup now reports clearer “missing native runtime” guidance when a compatible cached runtime isn’t available.
  • Documentation
    • Updated embedded-node instructions to follow: compatibility check → install (if needed) → initialize host runtime → start serving (cached runtime only).
  • Tests
    • Added tests covering compatibility behavior and the README’s documented execution order.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Embedded serving now checks for a compatible cached native runtime before startup, loads it when available, and reports version, ABI, and cache requirements when missing. The SDK exposes initialization and compatibility helpers, while README guidance and tests document and validate the installation sequence.

Changes

Embedded native runtime readiness

Layer / File(s) Summary
Runtime compatibility contracts and SDK exports
crates/mesh-llm-runtime-install/src/lib.rs, crates/mesh-llm-host-runtime/src/sdk/native_runtime.rs, crates/mesh-llm-embedded-runtime/src/lib.rs, crates/mesh-llm-sdk/src/lib.rs
Adds exact MeshLLM version and Skippy ABI validation, and re-exports native-runtime helpers and initialize_host_runtime.
Cached native runtime loading
crates/mesh-llm-host-runtime/src/system/native_runtime.rs
Resolves and loads a cached runtime matching the current release and ABI, returning no runtime when no compatible plan exists.
Embedded startup readiness gate
crates/mesh-llm-host-runtime/src/sdk.rs, crates/mesh-llm-host-runtime/src/sdk/embedded_startup.rs
Checks native-runtime readiness before embedded startup, bypasses client or already-loaded cases, and reports missing-runtime details.
SDK installation guidance and validation
crates/mesh-llm-sdk/README.md, crates/mesh-llm-sdk/tests/native_runtime_guidance.rs
Documents and tests the version check, explicit installation, host initialization, and embedded serving sequence.

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

Sequence Diagram(s)

sequenceDiagram
  participant SDKConsumer
  participant start_embedded_node
  participant prepare_embedded_native_runtime
  participant RuntimeCache
  SDKConsumer->>SDKConsumer: Check and install required runtime
  SDKConsumer->>start_embedded_node: Start embedded serving
  start_embedded_node->>prepare_embedded_native_runtime: Validate embedded runtime readiness
  prepare_embedded_native_runtime->>RuntimeCache: Load compatible cached runtime
  RuntimeCache-->>prepare_embedded_native_runtime: Runtime loaded or unavailable
  prepare_embedded_native_runtime-->>start_embedded_node: Continue startup or return error
Loading

Possibly related PRs

Suggested reviewers: i386

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.16% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the PR's focus on embedded native-runtime compatibility guidance.
Linked Issues check ✅ Passed The PR covers the requested docs, explicit install flow, host-runtime initialization, clearer errors, and avoids implicit downloads.
Out of Scope Changes check ✅ Passed The code changes stay on-mission around embedded serving guidance, startup checks, and supporting tests/docs.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-1016-sdk-runtime-guidance

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.

@ndizazzo

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request is currently a draft. Reviews will not take place until the PR is marked as ready for review.

@ndizazzo

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ndizazzo

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@ndizazzo
ndizazzo marked this pull request as ready for review July 21, 2026 18:49
@github-actions
github-actions Bot requested a review from i386 July 21, 2026 18:49
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@crates/mesh-llm-sdk/README.md`:
- Around line 96-101: Update the runtime selection example around
matching_runtime to resolve compatibility using the same host-profile and
RuntimeSelection checks as startup, rather than only
native_runtime_versions_match_current_sdk. Prefer install_native_runtime for
explicit compatible resolution when appropriate, ensuring unavailable
platform/backend libraries trigger installation before proceeding to start.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 238b2c9a-e587-4f85-b6ac-d48d920d21b2

📥 Commits

Reviewing files that changed from the base of the PR and between a6c7ddb and ba7ba3b.

📒 Files selected for processing (9)
  • crates/mesh-llm-embedded-runtime/src/lib.rs
  • crates/mesh-llm-host-runtime/src/sdk.rs
  • crates/mesh-llm-host-runtime/src/sdk/embedded_startup.rs
  • crates/mesh-llm-host-runtime/src/sdk/native_runtime.rs
  • crates/mesh-llm-host-runtime/src/system/native_runtime.rs
  • crates/mesh-llm-runtime-install/src/lib.rs
  • crates/mesh-llm-sdk/README.md
  • crates/mesh-llm-sdk/src/lib.rs
  • crates/mesh-llm-sdk/tests/native_runtime_guidance.rs

Comment thread crates/mesh-llm-sdk/README.md Outdated
@ndizazzo ndizazzo changed the title Improve embedded native-runtime compatibility guidance chore: improve embedded native-runtime compatibility guidance Jul 21, 2026
@ndizazzo
ndizazzo force-pushed the codex/issue-1016-sdk-runtime-guidance branch 3 times, most recently from 86cf9c1 to acbf2ab Compare July 24, 2026 00:53

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/mesh-llm-sdk/README.md (1)

79-82: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Declare the dependencies used by this example.

The runnable example uses tokio::main, anyhow::Result, and anyhow::ensure!, but the Cargo.toml dependency block only declares mesh-llm-sdk. Add compatible tokioandanyhow` dependencies so the documented setup compiles as written.

🤖 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-sdk/README.md` around lines 79 - 82, Add compatible tokio and
anyhow entries to the README example’s [dependencies] block alongside
mesh-llm-sdk, enabling tokio::main, anyhow::Result, and anyhow::ensure! used by
the runnable example. Preserve the existing mesh-llm-sdk dependency and serving
feature.
🤖 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.

Outside diff comments:
In `@crates/mesh-llm-sdk/README.md`:
- Around line 79-82: Add compatible tokio and anyhow entries to the README
example’s [dependencies] block alongside mesh-llm-sdk, enabling tokio::main,
anyhow::Result, and anyhow::ensure! used by the runnable example. Preserve the
existing mesh-llm-sdk dependency and serving feature.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 463f81bd-f865-4382-a872-56aa12463f71

📥 Commits

Reviewing files that changed from the base of the PR and between 86cf9c1 and acbf2ab.

📒 Files selected for processing (9)
  • crates/mesh-llm-embedded-runtime/src/lib.rs
  • crates/mesh-llm-host-runtime/src/sdk.rs
  • crates/mesh-llm-host-runtime/src/sdk/embedded_startup.rs
  • crates/mesh-llm-host-runtime/src/sdk/native_runtime.rs
  • crates/mesh-llm-host-runtime/src/system/native_runtime.rs
  • crates/mesh-llm-runtime-install/src/lib.rs
  • crates/mesh-llm-sdk/README.md
  • crates/mesh-llm-sdk/src/lib.rs
  • crates/mesh-llm-sdk/tests/native_runtime_guidance.rs
🚧 Files skipped from review as they are similar to previous changes (8)
  • crates/mesh-llm-sdk/src/lib.rs
  • crates/mesh-llm-embedded-runtime/src/lib.rs
  • crates/mesh-llm-host-runtime/src/sdk/native_runtime.rs
  • crates/mesh-llm-runtime-install/src/lib.rs
  • crates/mesh-llm-host-runtime/src/sdk/embedded_startup.rs
  • crates/mesh-llm-sdk/tests/native_runtime_guidance.rs
  • crates/mesh-llm-host-runtime/src/system/native_runtime.rs
  • crates/mesh-llm-host-runtime/src/sdk.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.

The new native-runtime example is not self-contained as written: its dependency block only adds mesh-llm-sdk, while the code uses #[tokio::main], anyhow::Result, and anyhow::ensure!. Copying it into a fresh crate therefore fails to resolve tokio and anyhow. Please include the required tokio (runtime + macros) and anyhow dependencies, ideally with a compile test for the full example.

@ndizazzo
ndizazzo force-pushed the codex/issue-1016-sdk-runtime-guidance branch from acbf2ab to c1f4644 Compare July 26, 2026 22:55

@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.

LGTM

@ndizazzo
ndizazzo merged commit f34f773 into main Jul 26, 2026
26 checks passed
@ndizazzo
ndizazzo deleted the codex/issue-1016-sdk-runtime-guidance branch July 26, 2026 23:22
michaelneale added a commit that referenced this pull request Jul 27, 2026
* origin/main:
  Fix Metal small-batch matmul parity for GLM verification (#1078)
  Handle K-only transposed KV page import and export (#1084)
  Refresh llama.cpp upstream patch queue (#1085)
  chore: improve embedded native-runtime compatibility guidance (#1043)
  fix(console-ui): chat transcript snapping during live status updates (#1083)
  ci: bump Linux CUDA slim container to gha-convention base runner image
  fix: record activation cache prefix identities (#1041)
  fix: read-only model download caches (#1042)
  ci: disable sccache for Windows ROCm native runtime build (#1087)
  ci: fix v0.74 release GPU builds (sccache disk-only + force_hosted_runners) (#1086)
  Make release sccache failures non-fatal (#1079)
  Keep client-only nodes out of model election (#1074)

# Conflicts:
#	crates/mesh-llm-host-runtime/src/runtime/auto_join.rs
#	crates/mesh-llm-host-runtime/src/runtime/tests/auto_join.rs
#	third_party/llama.cpp/patches/0004-Add-lanes-external-media-and-chat-grammar-support.patch
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.

SDK docs: document native-runtime version-check pattern; clearer error on embedded serve

2 participants