Skip to content

test(host-runtime): render fixture paths through TOML at six more sites - #1888

Merged
i386 merged 1 commit into
mainfrom
fix/toml-fixture-paths-windows
Sep 15, 2026
Merged

i386 merged 1 commit into
mainfrom
fix/toml-fixture-paths-windows

Conversation

@Virgile-pct

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

Copy link
Copy Markdown
Collaborator

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.

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.

Six 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 the
`\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:

    resolver/exact_head_tests.rs:50                  2 tests
    resolver/native_mtp_tests.rs:389 and :1030       2 tests
    runtime/local_split/test_support.rs:693 and :704 1 test, one template
    runtime/local_split/tests/content_attestation.rs:85   1 test

The `local_split` template carries two `[[models]]` entries that share one
`{model_path}` argument, so both placeholders lose their quotes together.

Each site now 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: a path without backslashes or quotes renders as the same
basic string.
@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: 7a43662b-70af-4297-bb3e-3b12fea5354c

📥 Commits

Reviewing files that changed from the base of the PR and between 8ab3586 and 1ffe26c.

📒 Files selected for processing (4)
  • crates/mesh-llm-host-runtime/src/inference/skippy/resolver/exact_head_tests.rs
  • crates/mesh-llm-host-runtime/src/inference/skippy/resolver/native_mtp_tests.rs
  • crates/mesh-llm-host-runtime/src/runtime/local_split/test_support.rs
  • crates/mesh-llm-host-runtime/src/runtime/local_split/tests/content_attestation.rs

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


📝 Walkthrough

Walkthrough

The test fixtures now serialize filesystem paths as TOML values. This replaces manual quoting and display formatting across resolver and runtime tests.

Changes

TOML path serialization

Layer / File(s) Summary
Update test fixture path serialization
crates/mesh-llm-host-runtime/src/inference/skippy/resolver/*_tests.rs, crates/mesh-llm-host-runtime/src/runtime/local_split/*
Test configurations now use toml_path or toml::Value::String for model, projector, hardware model, and external sidecar paths.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: ndizazzo, i386

Merge Risk: ⚪ Minimal · up to 1ffe2

The test fixtures preserve filesystem paths through TOML serialization, with no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. 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 clearly and concisely describes the main change: updating six host-runtime test sites to render fixture paths safely through TOML.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/toml-fixture-paths-windows

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.

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

Reviewed all seven render sites (the six tests plus the shared {model_path} template used by two [[models]] entries). Every path now goes through toml::Value::String(...) (or the existing toml_path helper), which quotes and escapes for TOML — the same fix as #1834. Purely test code, byte-identical output on Unix since a plain path renders as the same basic string. CI green (the one red Rust Clippy (${{ matrix.batch.id }}) entry is a stale unrendered matrix job with no logs, the real clippy batches 0-2 all pass). Approving.

@i386
i386 merged commit ade60ad into main Sep 15, 2026
58 of 67 checks passed
@i386
i386 deleted the fix/toml-fixture-paths-windows branch September 15, 2026 23:43
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