Skip to content

Require explicit native runtime version selection - #873

Merged
i386 merged 3 commits into
mainfrom
codex/native-runtime-version-selector
Jun 20, 2026
Merged

Require explicit native runtime version selection#873
i386 merged 3 commits into
mainfrom
codex/native-runtime-version-selector

Conversation

@i386

@i386 i386 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

MeshLLM now pairs native runtimes with an explicit MeshLLM version and Skippy ABI instead of accepting any cached runtime with a matching ABI.

What changed

  • Native runtime resolution now rejects stale cached runtime artifacts when their mesh_version does not match the selected MeshLLM runtime version.
  • Startup defaults to the running binary's MeshLLM release version and current Skippy ABI.
  • Added an explicit config override:
[runtime.native_runtime]
mesh_version = "0.68.0"
skippy_abi = "0.1.25"
  • mesh-llm runtime install and mesh-llm runtime list --available use the same explicit selector from config.
  • macOS native runtime packaging now rewrites local dylib dependencies to packaged @rpath/... names and adds @loader_path; package verification now catches absolute packaged-dylib dependencies and missing @loader_path.

Why

Upgrading from a MeshLLM version without separate native runtimes could leave an old cached runtime, such as 0.68.0, selected by a newer binary. On macOS, that stale runtime could then fail during dlopen because packaged dylibs still referenced build-tree paths for sibling llama libraries.

Runtime install scenarios

Scenario Behavior
Fresh install, no config Installs the recommended native runtime for the new MeshLLM release, then prunes with the current release active.
Upgrade, no config The new binary installs the new release runtime; old cached runtimes are rejected by mesh_version mismatch and pruned.
Startup, matching runtime already cached Loads the cached runtime directly; no install attempt.
Startup, no compatible cached runtime Attempts a one-shot install for the selected version; if install fails, continues without a dynamic native runtime.
Config pins only mesh_version Install derives ABI from that release manifest; startup, prune, and doctor target that version.
Config pins mesh_version + skippy_abi Resolver requires both exact MeshLLM version and ABI.
Config pins selection Startup, install, list, and doctor use that selection, e.g. cuda12 or exact:....
CLI runs runtime install cuda12 with config selection CLI positional selection wins for that install invocation.
Upgrade while pinned to old version New binary honors the pin; runtime prune --active-only keeps the pinned version instead of pruning it away.
Explicit runtime prune --mesh-version X Explicit CLI version wins over config.
Bad config has skippy_abi or selection without mesh_version Config validation fails.
runtime list --installed with bad config Still lists cache; it does not load config.
runtime list --available with no compatible runtime Prints each artifact plus rejection reasons.
Cached runtime manifest omits mesh_version Rejected; it is not rewritten to the selected version.
Bundle has same runtime ID but wrong version/ABI Not used as source for the selected artifact.
mesh-llm doctor with pin Shows running version, selected runtime version, configured ABI/selection, and pinned status.

Validation

  • cargo check -p mesh-llm
  • cargo test -p mesh-llm-native-runtime --lib
  • cargo test -p mesh-llm-config --lib
  • cargo test -p mesh-llm-host-runtime --features dynamic-native-runtime --lib system::native_runtime
  • bash -n scripts/package-native-runtime.sh
  • bash -n scripts/verify-native-runtime-package.sh
  • cargo fmt --all -- --check
  • cargo clippy -p mesh-llm --all-targets -- -D warnings
  • cargo clippy -p mesh-llm --features dynamic-native-runtime --all-targets -- -D warnings

Summary by CodeRabbit

  • New Features
    • Added [runtime.native_runtime] settings to pin native mesh_version, skippy_abi, and selection for native runtime resolution.
    • Native runtime list/install/remove/prune/doctor now render via consistent human/JSON output, including more detailed doctor reporting for pinned versions.
  • Bug Fixes
    • Native runtime resolution now rejects candidates with mismatched mesh versions (in addition to ABI/compat checks).
    • Install no longer implicitly fills skippy_abi_version when not provided.
    • macOS packaging now rewrites staged library paths/dependencies and enforces @loader_path in verification.
  • Tests / Documentation
    • Added config parsing/validation tests and updated the native runtimes pinning documentation.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR introduces config-file-driven mesh_version/skippy_abi selection for native runtime operations, allowing users to pin runtime resolution via [runtime.native_runtime] in their config file. A new NativeRuntimeConfig struct is added to RuntimeConfig, validated for co-presence, and threaded through the CLI dispatcher, host-runtime initialization, startup resolver, and list/install/doctor commands. The resolver gains a MeshVersionMismatch rejection variant and artifact identity matching based on mesh version. skippy_abi_version becomes optional in install options, falling back to manifest-provided values when not explicitly set. A new output formatting layer abstracts human and JSON rendering across all native runtime commands. Separately, macOS dylib rpath rewriting and verification are added to the packaging and verification scripts.

Changes

Config-driven native runtime version selection

Layer / File(s) Summary
NativeRuntimeConfig model, schema, and validation
crates/mesh-llm-config/src/model.rs, crates/mesh-llm-config/src/model/built_in_schema.rs, crates/mesh-llm-config/src/validate.rs, crates/mesh-llm-config/src/lib.rs
NativeRuntimeConfig with optional mesh_version, skippy_abi, and selection fields is added to RuntimeConfig, registered in the built-in schema, and validated by a new validate_runtime_config helper that requires mesh_version to be set when skippy_abi or selection is configured. Tests cover partial-override rejection and canonical field counting.
Resolver mesh-version enforcement and artifact matching
crates/mesh-llm-native-runtime/src/resolver.rs, crates/mesh-llm-native-runtime/src/lib.rs
CandidateRejection::MeshVersionMismatch is added; release-manifest artifacts are normalized via artifact_with_manifest_mesh_version before evaluation; evaluate_artifact rejects candidates whose mesh version does not match the requested version; artifact_key deduplication now includes mesh_version and skippy_abi; artifact_identity_matches is introduced for selection-to-source mapping. Tests updated to expect mismatch behavior and verify mesh-version-aware identity matching.
Make skippy_abi_version optional in install options
crates/mesh-llm-runtime-install/src/lib.rs, crates/mesh-llm-ffi/src/lib.rs, crates/mesh-llm-nodejs/src/lib.rs
NativeRuntimeInstallOptions.skippy_abi_version is changed from required String to Option<String> with default None. During install_native_runtime, the resolver uses options.skippy_abi_version when present, otherwise falls back to manifest.skippy_abi. FFI and Node.js bindings no longer auto-default skippy_abi_version.
NativeRuntimeStartupSelection and host-runtime startup wiring
crates/mesh-llm-host-runtime/src/system/native_runtime.rs, crates/mesh-llm-host-runtime/src/lib.rs, crates/mesh-llm-host-runtime/src/plugin/config.rs
NativeRuntimeStartupSelection is introduced with current() and explicit() constructors, carrying mesh_version, optional skippy_abi, and runtime_selection. try_load_installed_native_runtime accepts and threads it through startup-plan and installed-plan resolution. initialize_host_runtime_with_config loads config, derives the selection from NativeRuntimeConfig, and attempts to load an installed native runtime. Tests updated to pass explicit selection values.
Native runtime output formatting
crates/mesh-llm-commands/src/runtime_native/formatters.rs
New RuntimeNativeFormatter trait defines a common interface for rendering native runtime operations (list, install, remove, prune, doctor). HumanFormatter and JsonFormatter implementations provide human-readable and JSON output respectively. AvailableRuntimeRow and NativeRuntimeDoctorReport data types carry operation results and diagnostic information. Helper functions map all CandidateRejection variants to human-readable descriptions.
CLI dispatcher and command wiring
crates/mesh-llm/src/commands/runtime.rs, crates/mesh-llm/src/commands/mod.rs, crates/mesh-llm/src/lib.rs, crates/mesh-llm-commands/src/runtime_native.rs, crates/mesh-llm/src/commands/doctor.rs
dispatch_runtime_command gains config_path parameter; List (when available), Install, and Prune arms load NativeRuntimeConfigSelector and thread mesh_version/skippy_abi/selection into corresponding runtime commands. run_native_runtime_list, run_native_runtime_install, and run_native_runtime_doctor signatures expand to accept configured selection and delegate rendering to runtime_native_formatter. run_native_runtime_doctor output now reports configured pin/status (selected vs running mesh version), configured Skippy ABI and selection, and installed counts per selected mesh version. run_native_runtime_remove delegates output to formatters. CLI entrypoint switches to initialize_host_runtime_with_config.

macOS dylib rpath rewriting

Layer / File(s) Summary
macOS dylib path rewriting in packaging and verification scripts
scripts/package-native-runtime.sh, scripts/verify-native-runtime-package.sh
rewrite_macos_runtime_paths is added to the packaging script to set each staged dylib's install id to @rpath/<basename>, ensure @loader_path is present in rpaths, and rewrite otool -L reported dependency references to @rpath/<candidate_basename> when the dependency matches a staged library. verify_macos_runtime_paths is added to the verification script to reject absolute-path dependencies and verify @loader_path is present in dylib link info.
Native runtime configuration documentation
docs/design/NATIVE_RUNTIMES.md
Adds documented advanced configuration option to pin native runtime resolution via ~/.mesh-llm/config.toml under [runtime.native_runtime], including mesh_version and optional skippy_abi and selection (with exact: artifact-id example). Specifies precedence and which commands honor the pin.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as run_cli_entrypoint
    participant HostRuntime as initialize_host_runtime_with_config
    participant Config as plugin::load_config
    participant Selector as NativeRuntimeStartupSelection
    participant Loader as try_load_installed_native_runtime
    participant Resolver as resolve_installed_native_runtime_plan

    CLI->>HostRuntime: config_path
    HostRuntime->>Config: load_config(config_path)
    Config-->>HostRuntime: RuntimeConfig {native_runtime}
    HostRuntime->>Selector: explicit(mesh_version, skippy_abi) or current()
    HostRuntime->>Loader: startup_selection
    Loader->>Resolver: target_mesh_version, target_skippy_abi
    Resolver-->>Loader: Option<LoadedNativeRuntime>
    Loader-->>HostRuntime: Result<Option<LoadedNativeRuntime>>
Loading
sequenceDiagram
    participant CLI as dispatch_runtime_command
    participant Selector as native_runtime_config_selector
    participant Commands as run_native_runtime_list/install
    participant Formatter as runtime_native_formatter
    participant Output as stdout/stderr

    CLI->>Selector: load config_path
    Selector-->>CLI: Option<NativeRuntimeConfigSelector>
    CLI->>Commands: NativeRuntimeConfigSelection {mesh_version, skippy_abi, selection}
    Commands->>Formatter: render_available/render_installed/render_doctor
    Formatter-->>Output: human or JSON
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Mesh-LLM/mesh-llm#854: Modifies validate_config_diagnostics in crates/mesh-llm-config/src/validate.rs, the same function this PR extends by adding validate_runtime_config.
  • Mesh-LLM/mesh-llm#869: Modifies the host-runtime initialization flow and mesh-llm entrypoint behavior, so this PR's config-aware initialize_host_runtime_with_config is directly tied to initialization changes in the retrieved PR.

Suggested reviewers

  • michaelneale
  • ndizazzo
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.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 'Require explicit native runtime version selection' clearly and directly describes the main change in the PR, which is implementing explicit native runtime version selection across MeshLLM.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/native-runtime-version-selector

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

@i386 i386 changed the title [codex] Require explicit native runtime version selection Require explicit native runtime version selection Jun 18, 2026
@ndizazzo
ndizazzo marked this pull request as ready for review June 18, 2026 21:00
@github-actions
github-actions Bot requested a review from ndizazzo June 18, 2026 21:00

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

Actionable comments posted: 6

🤖 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-host-runtime/src/system/native_runtime.rs`:
- Around line 214-228: The issue is that the synthesized manifest passed to
select_native_runtime_for_skippy_abi will have its artifacts normalized to fill
in missing mesh_version fields from the parent manifest, allowing stale cached
runtimes to be selected. Replace the call to
select_native_runtime_for_skippy_abi with an installed-artifact-specific
selection function that evaluates cached manifests without normalizing missing
mesh_version values. Additionally, add a regression test that verifies an
installed runtime whose manifest omits mesh_version is not incorrectly rewritten
or selected.

In `@crates/mesh-llm-native-runtime/src/resolver.rs`:
- Around line 161-166: After normalizing artifacts with
artifact_with_manifest_mesh_version in the resolver, add validation to ensure
that source_for_artifact returns bundles with matching mesh_version and
skippy_abi before using them. Compare the full artifact identity of the bundle
source against the normalized artifact's mesh_version and skippy_abi fields
before proceeding with seen.insert and artifacts.push operations. Apply this
validation check at both locations where artifact_with_manifest_mesh_version is
called (around lines 161-166 and 194-199) to prevent stale bundles with matching
runtime ids from bypassing version-selection guarantees.

In `@crates/mesh-llm/src/commands/runtime.rs`:
- Around line 21-23: The native_runtime_config_selector is being loaded
unconditionally before calling run_native_runtime_list, but the selector is only
used when listing available runtimes with the --available flag. For installed or
default listings, the function only reads from cache and doesn't use the
selector, so a bad config shouldn't cause failures. Move the
native_runtime_config_selector call inside a conditional block that only
executes when the --available variant is being handled, ensuring the selector is
only created and validated when it's actually needed by the command.

In `@scripts/package-native-runtime.sh`:
- Around line 258-259: The install_name_tool commands for rewriting the library
identity and adding rpaths are critical safety operations that should not
silently fail. Remove the `|| true` suppression from the install_name_tool -id
command to ensure identity rewrites fail properly if they encounter errors. For
the install_name_tool -add_rpath command, instead of using blanket `|| true`
suppression, selectively handle only the duplicate rpath error case while
allowing actual failures to propagate and cause the script to exit with an
error.

In `@scripts/verify-native-runtime-package.sh`:
- Around line 146-148: The find command in the dylib detection logic uses -type
f which only matches regular files and ignores symlinks. Since the artifact
directory can contain .dylib symlinks, this causes the check to incorrectly
return 0 when only symlinks exist, skipping necessary macOS path validation.
Modify the find command to detect both regular files and symlinks by either
replacing -type f with a condition that matches both types (using -type f -o
-type l) or by removing the type restriction entirely, ensuring the detection
correctly identifies both .dylib files and .dylib symlinks in the artifact_dir.
- Around line 175-177: The current check for "`@loader_path`" uses a simple string
containment search on the entire otool output, which incorrectly passes if
"`@loader_path`" appears anywhere in the output rather than specifically within an
LC_RPATH load command. Modify the logic at line 175-177 to parse the otool
output and explicitly look for LC_RPATH sections, then verify that
"`@loader_path`" appears within those specific LC_RPATH command blocks rather than
just somewhere in the output. This ensures only valid packages with properly
configured LC_RPATH entries are accepted.
🪄 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: 5dec15d1-afa1-4283-853f-4bfcaeb70c18

📥 Commits

Reviewing files that changed from the base of the PR and between 10bc0e0 and 6f73fee.

📒 Files selected for processing (14)
  • crates/mesh-llm-commands/src/runtime_native.rs
  • crates/mesh-llm-config/src/lib.rs
  • crates/mesh-llm-config/src/model.rs
  • crates/mesh-llm-config/src/model/built_in_schema.rs
  • crates/mesh-llm-config/src/validate.rs
  • crates/mesh-llm-host-runtime/src/lib.rs
  • crates/mesh-llm-host-runtime/src/plugin/config.rs
  • crates/mesh-llm-host-runtime/src/system/native_runtime.rs
  • crates/mesh-llm-native-runtime/src/resolver.rs
  • crates/mesh-llm/src/commands/mod.rs
  • crates/mesh-llm/src/commands/runtime.rs
  • crates/mesh-llm/src/lib.rs
  • scripts/package-native-runtime.sh
  • scripts/verify-native-runtime-package.sh

Comment thread crates/mesh-llm-host-runtime/src/system/native_runtime.rs
Comment thread crates/mesh-llm-native-runtime/src/resolver.rs
Comment thread crates/mesh-llm/src/commands/runtime.rs
Comment thread scripts/package-native-runtime.sh Outdated
Comment thread scripts/verify-native-runtime-package.sh Outdated
Comment thread scripts/verify-native-runtime-package.sh

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

I've been having some struggles with the ergonomics of the CLI lately - so my review is going to be a bit more centred around the experience:

  1. runtime list --available wont give any rejection reasons if there's nothing comparable... largely because resolver.rs bails out before returning any evaluated candidates against a matched runtime.
  2. native runtime config schema understates the restart boundary. (my agent found this one):
The new settings are registered via runtime_setting at
[built_in_schema.rs (line 143)]
(mesh-llm-config/src/model/built_in_schema.rs:143), and that helper
marks runtime settings as API-visible / dynamic-validation-only while
inheriting ModelReload restart scope from basic_setting at
[built_in_schema.rs (line 895)]
(crates/mesh-llm-config/src/model/built_in_schema.rs:895).

But the selector is consumed before dynamic native libraries are loaded
during host initialization in [lib.rs (line 63)]
(crates/mesh-llm-host-runtime/src/lib.rs:63).

This should be a process-restart setting, probably with a
native-runtime-specific schema helper and a clearer description.
Otherwise the UI/API can imply that a model reload is sufficient.

Otherwise, seems like a good change. I tend to want poweruser-type features and this has the right config additions I would wanna see. A rough improvement there would be helping the discoverability of this (doc might be fine, or add to the sample templates).

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

🧹 Nitpick comments (1)
docs/design/NATIVE_RUNTIMES.md (1)

329-341: ⚡ Quick win

Clarify the selection field and its relationship to mesh_version.

The configuration example (lines 331–335) shows both mesh_version and selection fields, but the prose explanation (lines 337–341) only describes mesh_version and skippy_abi. Users need to understand:

  1. What the selection field represents and how to use it (e.g., the exact:<artifact-id> syntax shown in the example).
  2. Whether both fields can be specified together, and if so, what takes precedence or if they have specific validation rules.
  3. The relationship between selection and the auto-detection behavior when neither field is provided.

Add a sentence or two to the prose explaining the selection field's purpose and usage pattern.

🤖 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 `@docs/design/NATIVE_RUNTIMES.md` around lines 329 - 341, The prose explanation
following the configuration example does not adequately describe the `selection`
field, which is shown in the example but not explained in the text. Add
clarification to the section after the TOML code block to explain what the
`selection` field represents, describe the `exact:<artifact-id>` syntax pattern
shown in the example, clarify whether `mesh_version` and `selection` can both be
specified together and what their relationship is (precedence, validation
rules), and explain how specifying `selection` relates to the auto-detection
behavior that occurs when neither field is provided. Keep the explanation
concise but complete enough for users to understand the purpose and usage of the
`selection` field.
🤖 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 `@docs/design/NATIVE_RUNTIMES.md`:
- Around line 329-341: The prose explanation following the configuration example
does not adequately describe the `selection` field, which is shown in the
example but not explained in the text. Add clarification to the section after
the TOML code block to explain what the `selection` field represents, describe
the `exact:<artifact-id>` syntax pattern shown in the example, clarify whether
`mesh_version` and `selection` can both be specified together and what their
relationship is (precedence, validation rules), and explain how specifying
`selection` relates to the auto-detection behavior that occurs when neither
field is provided. Keep the explanation concise but complete enough for users to
understand the purpose and usage of the `selection` field.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1469e557-2bdf-4d30-b7c3-287e7371879b

📥 Commits

Reviewing files that changed from the base of the PR and between 6f73fee and 79b3a00.

📒 Files selected for processing (18)
  • crates/mesh-llm-commands/src/runtime_native.rs
  • crates/mesh-llm-config/src/lib.rs
  • crates/mesh-llm-config/src/model.rs
  • crates/mesh-llm-config/src/model/built_in_schema.rs
  • crates/mesh-llm-config/src/validate.rs
  • crates/mesh-llm-ffi/src/lib.rs
  • crates/mesh-llm-host-runtime/src/lib.rs
  • crates/mesh-llm-host-runtime/src/system/native_runtime.rs
  • crates/mesh-llm-native-runtime/src/lib.rs
  • crates/mesh-llm-native-runtime/src/resolver.rs
  • crates/mesh-llm-nodejs/src/lib.rs
  • crates/mesh-llm-runtime-install/src/lib.rs
  • crates/mesh-llm/src/commands/doctor.rs
  • crates/mesh-llm/src/commands/mod.rs
  • crates/mesh-llm/src/commands/runtime.rs
  • docs/design/NATIVE_RUNTIMES.md
  • scripts/package-native-runtime.sh
  • scripts/verify-native-runtime-package.sh
🚧 Files skipped from review as they are similar to previous changes (6)
  • crates/mesh-llm-host-runtime/src/lib.rs
  • scripts/package-native-runtime.sh
  • crates/mesh-llm-config/src/lib.rs
  • scripts/verify-native-runtime-package.sh
  • crates/mesh-llm/src/commands/mod.rs
  • crates/mesh-llm-native-runtime/src/resolver.rs

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

🧹 Nitpick comments (2)
crates/mesh-llm-commands/src/runtime_native/formatters.rs (1)

333-335: 💤 Low value

Minor inconsistency in rejection message wording.

The TargetTripleMismatch message says "host is {actual}" while other mismatch messages (lines 328, 331) use "artifact is for {actual}". The semantic is that expected is what the host needs and actual is what the artifact provides, so this message has the labels reversed or uses inconsistent phrasing.

Suggested fix for consistency
         CandidateRejection::TargetTripleMismatch { expected, actual } => {
-            format!("target triple mismatch: expected {expected}, host is {actual}")
+            format!("target triple mismatch: expected {expected}, artifact is for {actual}")
         }
🤖 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-commands/src/runtime_native/formatters.rs` around lines 333 -
335, The TargetTripleMismatch error message in the match expression uses
inconsistent phrasing compared to other rejection messages. Change the message
from "target triple mismatch: expected {expected}, host is {actual}" to use
"artifact is for {actual}" instead of "host is {actual}" to match the phrasing
pattern used in the other CandidateRejection variants (appearing around lines
328 and 331), ensuring consistency in how the actual value is described across
all mismatch rejection messages.
crates/mesh-llm-commands/src/runtime_native.rs (1)

39-54: ⚡ Quick win

Redundant native_runtime_cache call.

native_runtime_cache(cache_dir)? is called at line 39 unconditionally, and then again at line 54 inside the if available block. When available is true, the cache from line 39 is unused; when available is false, only the cache from line 39 is used.

Consider moving the cache creation to where it's needed to avoid the redundant call in the available path.

Suggested fix
     let mesh_version = configured.mesh_version_or_current();
     let selection = RuntimeSelection::parse(configured.selection)?;
-    let cache = native_runtime_cache(cache_dir)?;
     let formatter = runtime_native_formatter(json_output);
     if available {
         print_configured_selector(configured, json_output);
         if !json_output && manifest_path.is_none() && bundle_dirs.is_empty() {
             eprintln!("🔎 Loading native runtime release manifest");
         }
         // ... manifest loading ...
         let profile = host_runtime_profile();
         let cache = native_runtime_cache(cache_dir)?;
         // ... resolver and rows ...
         return formatter.render_available(&rows);
     }

+    let cache = native_runtime_cache(cache_dir)?;
     let installed = cache.installed()?;
     formatter.render_installed(&installed, cache.root())
🤖 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-commands/src/runtime_native.rs` around lines 39 - 54, The
function native_runtime_cache(cache_dir)? is called redundantly - once at the
beginning before the if available block and again inside that block. Remove the
duplicate call to native_runtime_cache inside the if available block (currently
at line 54) and reuse the cache variable that was already created and assigned
at line 39 before the conditional. This eliminates the unnecessary duplicate
function call in the available code path.
🤖 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-commands/src/runtime_native.rs`:
- Around line 39-54: The function native_runtime_cache(cache_dir)? is called
redundantly - once at the beginning before the if available block and again
inside that block. Remove the duplicate call to native_runtime_cache inside the
if available block (currently at line 54) and reuse the cache variable that was
already created and assigned at line 39 before the conditional. This eliminates
the unnecessary duplicate function call in the available code path.

In `@crates/mesh-llm-commands/src/runtime_native/formatters.rs`:
- Around line 333-335: The TargetTripleMismatch error message in the match
expression uses inconsistent phrasing compared to other rejection messages.
Change the message from "target triple mismatch: expected {expected}, host is
{actual}" to use "artifact is for {actual}" instead of "host is {actual}" to
match the phrasing pattern used in the other CandidateRejection variants
(appearing around lines 328 and 331), ensuring consistency in how the actual
value is described across all mismatch rejection messages.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9151eb2d-163a-42d9-80be-6b677eb77f19

📥 Commits

Reviewing files that changed from the base of the PR and between 79b3a00 and ecb7a52.

📒 Files selected for processing (2)
  • crates/mesh-llm-commands/src/runtime_native.rs
  • crates/mesh-llm-commands/src/runtime_native/formatters.rs

@i386
i386 merged commit 1324e61 into main Jun 20, 2026
27 of 28 checks passed
@i386
i386 deleted the codex/native-runtime-version-selector branch June 20, 2026 01:31
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.

2 participants