Skip to content

refactor(desktop): feature-gate mesh-llm-sdk behind optional Cargo feature#823

Merged
wpfleger96 merged 2 commits into
mainfrom
wpfleger/feature-gate-mesh-llm
Jun 2, 2026
Merged

refactor(desktop): feature-gate mesh-llm-sdk behind optional Cargo feature#823
wpfleger96 merged 2 commits into
mainfrom
wpfleger/feature-gate-mesh-llm

Conversation

@wpfleger96
Copy link
Copy Markdown
Collaborator

Make mesh-llm-sdk an optional dependency behind a mesh-llm Cargo feature (default OFF) so that skippy-ffi — and its build.rs that requires pre-built llama.cpp archives — never compiles unless explicitly opted in. This fixes fresh worktrees and CI where the archives don't exist and SKIPPY_LLAMA_AUTO_BUILD=0 (from #819) caused the build script to panic.

When the feature is off, stub Tauri commands return "mesh-llm feature not enabled" errors so the frontend IPC contract is preserved without any TypeScript changes. The dev, staging, and desktop-release-build Justfile recipes pass --features=mesh-llm via TAURI_CLI_EXTRA_CARGO_ARGS so developers who actually run the desktop app get mesh-llm compiled in. CI lint/check/test targets intentionally omit the feature — they don't need llama.cpp and now compile cleanly without it.

  • Gate mesh-llm-sdk as optional = true with mesh-llm = ["dep:mesh-llm-sdk"] feature
  • Add #[cfg(feature = "mesh-llm")] on mod mesh_llm, AppState::mesh_llm_runtime, relay_mesh_model_id, restore preflight, and related tests
  • Add mesh_llm_stubs module with 7 no-op Tauri command stubs for the disabled case
  • Delete desktop/src-tauri/.cargo/config.toml (SKIPPY_LLAMA_AUTO_BUILD=0 workaround from fix(desktop): disable mesh-llm auto-build to prevent git config corruption #819), superseded by the feature gate

Upstream fix for the git -C directory-escape bug in prepare-llama.sh: Mesh-LLM/mesh-llm#780

…ature

The skippy-ffi build.rs panics in fresh worktrees and CI when pre-built
llama.cpp archives are missing and SKIPPY_LLAMA_AUTO_BUILD=0. Rather
than requiring archives to exist, make mesh-llm-sdk an optional dep
(default OFF) so skippy-ffi never compiles unless explicitly opted in.

Stub Tauri commands return errors when the feature is off so the
frontend IPC contract is preserved. The dev, staging, and release-build
Justfile recipes pass --features=mesh-llm via TAURI_CLI_EXTRA_CARGO_ARGS.

Removes the broken SKIPPY_LLAMA_AUTO_BUILD=0 workaround from #819.
Wrap the mesh_preflight_failures set, preflight loop, and filtered
agents_to_start rebind in a single #[cfg(feature = "mesh-llm")] block
expression instead of three separate annotations on consecutive
statements.
@wpfleger96 wpfleger96 marked this pull request as ready for review June 2, 2026 20:21
@wpfleger96 wpfleger96 requested a review from a team as a code owner June 2, 2026 20:21
@wpfleger96 wpfleger96 enabled auto-merge (squash) June 2, 2026 20:21
@wpfleger96 wpfleger96 merged commit fb514c8 into main Jun 2, 2026
16 checks passed
@wpfleger96 wpfleger96 deleted the wpfleger/feature-gate-mesh-llm branch June 2, 2026 20:25
wpfleger96 added a commit that referenced this pull request Jun 2, 2026
The mesh_llm module in commands/mod.rs is private — its contents are
accessible only through the pub use re-export. Fixes compilation with
--features=mesh-llm introduced in #823.
tlongwell-block pushed a commit that referenced this pull request Jun 2, 2026
Rebased onto main, which feature-gated mesh-llm-sdk (optional dep + "mesh-llm"
feature, #823) and changed the ensure_client_node_for_model re-export (#824).
Resolved by carrying both: fork pin tlongwell-block/mesh-llm@bc2f1106 stays, now
also `optional = true`; restore.rs mesh preflight keeps the #[cfg(feature="mesh-llm")]
wrapper with our 3-arg ensure_client_node_for_model(..., None) signature.

Add no-op stubs for mesh_dial_endpoint_addr + mesh_status_report_payload to the
cfg(not(feature="mesh-llm")) stub module — the generate_handler! list references
them in all builds, so the default (feature-off) build needs the stubs (they were
present for the other mesh commands but not these two new ones). Lockfiles
regenerated. Verified: default build + with-feature build + desktop clippy
(-D warnings) + mesh-compute e2e (3/3) + relay suite (271/0) all green.

Signed-off-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Max <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co>
tlongwell-block pushed a commit that referenced this pull request Jun 2, 2026
The two no-op stubs added for the #823 feature-gate (mesh_dial_endpoint_addr,
mesh_status_report_payload — required so the default no-feature build's
generate_handler! list resolves) pushed lib.rs from 828 to 846 lines, over its
835 override. Bump to 850 with the justification extended; the additions are
the minimal feature-gate completeness the default build needs, not bloat.

Signed-off-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co>
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