Skip to content

fix(mesh): expose upsert_served_model_descriptor to production callers - #1885

Merged
ndizazzo merged 1 commit into
mainfrom
fix/upsert-served-model-descriptor-cfg
Sep 15, 2026
Merged

ndizazzo merged 1 commit into
mainfrom
fix/upsert-served-model-descriptor-cfg

Conversation

@Virgile-pct

@Virgile-pct Virgile-pct commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1884.

main at 85b142d does not build mesh-llm-host-runtime outside of cfg(test): runtime/model_presentation.rs:44 (from #1879, 20:51Z) calls Node::upsert_served_model_descriptor, and mesh/node.rs:1355 (from #1708, 20:56Z) still has that method under #[cfg(test)]. Each PR was green on its own base; the error only exists on the merged result, and Main · Quality on that head fails in all three Clippy batches with it.

What this changes

One line: the #[cfg(test)] attribute on upsert_served_model_descriptor goes away. The method has a production caller now, so it is no longer dead code outside tests, and nothing else moves.

Measured

Windows 11, cargo check -p mesh-llm-host-runtime:

main 85b142df0            error[E0599] ... model_presentation.rs:44:18
this branch               Finished

Not verified

I have not rerun the full test suite on this branch; the change removes a compile-time gate and adds no code. Nothing run on Linux or macOS.

Summary by CodeRabbit

  • New Features
    • Served model descriptors can now be added or updated in standard application builds, not only during testing.
    • Existing descriptors with the same model name are replaced; new model names are added.

`runtime/model_presentation.rs` calls `Node::upsert_served_model_descriptor`
from production code since #1879, and #1708 landed six minutes later with the
method still under `#[cfg(test)]`, because every caller it knew about was a
test or `runtime/local.rs`. Neither branch saw the other, so `main` at
85b142d no longer builds the crate outside of `cfg(test)`:

    error[E0599]: no method named `upsert_served_model_descriptor` found for
    reference `&mesh::node::Node` in the current scope
      --> crates/mesh-llm-host-runtime/src/runtime/model_presentation.rs:44:18

The `Main · Quality` run on that head fails in all three Clippy batches with
the same error. Dropping the attribute is the whole fix: the method has a
production caller now, so it is no longer dead code outside tests.

Reported in #1884.
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 67e1442e-5307-459d-93a4-dfb4ce570fb7

📥 Commits

Reviewing files that changed from the base of the PR and between 85b142d and 29adbfa.

📒 Files selected for processing (1)
  • crates/mesh-llm-host-runtime/src/mesh/node.rs
💤 Files with no reviewable changes (1)
  • crates/mesh-llm-host-runtime/src/mesh/node.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The #[cfg(test)] gate was removed from Node::upsert_served_model_descriptor, so production code can compile and call the method.

Changes

Model descriptor runtime availability

Layer / File(s) Summary
Enable production upsert
crates/mesh-llm-host-runtime/src/mesh/node.rs
Node::upsert_served_model_descriptor is now compiled in non-test builds. Its upsert behavior is unchanged.

Priority: ⬆️ High

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: High

Merge Risk: ⚪ Minimal · up to 29adb

The runtime startup path can again update served model descriptors in production. No actionable merge risk remains.

🚥 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 and concisely describes the main change: making upsert_served_model_descriptor available to production callers.
Linked Issues check ✅ Passed For #1884, the PR removes only the #[cfg(test)] attribute from Node::upsert_served_model_descriptor in crates/mesh-llm-host-runtime/src/mesh/node.rs. The method remains public and its implementa…
Out of Scope Changes check ✅ Passed The whole-PR diff contains one removed attribute in the file required by #1884. It does not move the method, change its behavior, or add unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
✨ 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 fix/upsert-served-model-descriptor-cfg

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
ndizazzo merged commit 8ab3586 into main Sep 15, 2026
62 of 69 checks passed
@ndizazzo
ndizazzo deleted the fix/upsert-served-model-descriptor-cfg branch September 15, 2026 15:27
i386 pushed a commit that referenced this pull request Sep 15, 2026
…es (#1888)

Six host-runtime tests build a `MeshConfig` by interpolating a temp path
straight into a TOML basic string. On Windows that path is
`C:\Users\...`, and TOML reads `\U` as the start of a unicode escape:

```
Error { message: "too few unicode value digits, expected unicode hexadecimal value" }
```

Same defect #1834 fixed in `mesh-llm-commands`, in the same shape.

## The six sites

| test | site |
|---|---|
|
`resolver::exact_head_tests::canonical_selector_wins_over_another_models_derived_profile`
| `resolver/exact_head_tests.rs:50` |
|
`resolver::exact_head_tests::served_alias_and_resolved_path_do_not_select_model_specific_config`
| same fixture |
|
`resolver::native_mtp_tests::speculative_strategy_auto_uses_hardware_model_path_for_direct_gguf_detection`
| `resolver/native_mtp_tests.rs:389` |
|
`resolver::native_mtp_tests::speculative_strategy_native_mtp_accepts_external_mtp_sidecar`
| `resolver/native_mtp_tests.rs:1030` |
|
`local_split::test_support::runtime_resolver_uses_config_identity_and_honors_device_override`
| `local_split/test_support.rs:693` and `:704`, one template |
|
`local_split::tests::content_attestation::strict_multimodal_stage_builder_keeps_local_paths_off_downstream_loads`
| `local_split/tests/content_attestation.rs:85` |

The `local_split` template carries two `[[models]]` entries that share a
single `{model_path}` argument, so both placeholders lose their quotes
together. My first pass fixed only the second one and the test kept
failing with the rendered literal string wrapped in a second pair of
quotes, which is how the seventh site turned up.

## What this changes

Each site renders the path through
`toml::Value::String(...).to_string()`, which quotes and escapes for
TOML, and the fixture drops its own quotes around the placeholder.
Nothing new is introduced: `resolver/test_support.rs` already has
`toml_path` doing exactly that, used eleven times by the speculative
tests, and `local_split/test_support.rs` already writes the same
expression three times a few lines below one of the sites that bypassed
it. The one addition is an explicit import in `exact_head_tests.rs`,
since `test_support` is a private module with no glob re-export.

On Linux and macOS the rendered value is byte-identical to what the
fixtures produced before, since a path without backslashes or quotes
renders as the same basic string.

## Measured effect

Windows 11. On `main` at 950e905 all six fail with the unicode-escape
error above. On this branch, the six plus the seven other tests of
`runtime::local_split::test_support`, run on the tree that `main` at
8ab3586 now has (85b142d plus #1885, which the run carried as a
cherry-pick because `main` did not build in between):

```
test result: ok. 13 passed; 0 failed; 0 ignored
```

## Gates

- `cargo test -p mesh-llm-host-runtime` (the six tests and
`runtime::local_split::test_support`): 13 passed, 0 failed.
- `cargo fmt --all --check`: clean.
- `cargo clippy -p mesh-llm-host-runtime --all-targets`: 8 locations,
complete sorted set identical to `main` at 60b7f5f.
- `cargo run -p xtask -- repo-consistency no-console-print`: passed.
- `scripts/check-env-mutation-contract.py` and `python -m unittest
scripts.tests.test_env_mutation_contract`: passed, 234 sites.
- `scripts/check-conventional-commit.py --range upstream/main..HEAD`:
passed.

## Not verified

Nothing run on Linux or macOS. The rendered TOML is the same there, but
I have not executed the tests on either.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Tests**
- Improved test configuration handling for model, projector, hardware
model, and sidecar paths.
- Added safer path serialization to preserve paths accurately across
different filesystem formats.
- Maintained coverage for model resolution, native MTP detection,
external sidecar resolution, and multimodal configuration validation.
- Updated test fixtures to use canonical path values, improving
reliability across environments.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.

main does not build: model_presentation.rs calls a cfg(test) method left by #1708

2 participants