Skip to content

fix(desktop): stop promising local-file model refs the SDK can't consume - #4104

Open
iroiro147 wants to merge 1 commit into
block:mainfrom
iroiro147:claude/issue4049-modelref-validation-20260801
Open

fix(desktop): stop promising local-file model refs the SDK can't consume#4104
iroiro147 wants to merge 1 commit into
block:mainfrom
iroiro147:claude/issue4049-modelref-validation-20260801

Conversation

@iroiro147

Copy link
Copy Markdown

Partial fix for #4049 (sub-issue 2 of 2).

What

The Share compute UI told users to "enter a model reference or local file", and classifyModelRef had a local-path branch that classified filesystem paths as valid. But the pinned mesh-llm SDK v0.74.0 only supports two ExactModelRef variants — Catalog and HuggingFace — so every local path ended in parse_exact_model_ref rejecting with "Expected an exact model ref".

This was a silent broken promise: the UI said the feature existed; the SDK said it didn't.

Two-part fix

  1. Copy alignment (MeshComputeSettingsCard.tsx): drop "or local file" from the descriptive text; add "local files are not supported yet" so the form no longer advertises a capability we cannot deliver.

  2. Validation alignment (classifyModelRef.ts): remove the local-path branch entirely. Local-path inputs (/, ./, ../, ~, *.gguf, file://) now classify as unknown, which keeps the Share button disabled with a clear UI-level signal rather than letting the submit bubble up a cryptic SDK error.

The fn-level doc comment explains the vendored-SDK constraint and points reclassification at an upstream SDK change gaining a LocalPath variant.

Out of scope (per the issue body's own split)

  • Sub-issue 1: the underlying ~70 MB layer-download stall inside the vendored download_model_ref_with_progress_details loop. That is an SDK-pin / transport-policy investigation and belongs in its own PR against the vendored mesh-llm crate. Not attempted here.
  • Supporting local files end-to-end: would require the SDK to grow a LocalPath variant in ExactModelRef plus wiring through EmbeddedServeConfig.models — an SDK change first, then a follow-up here.

Verification

  • pnpm exec tsc --noEmit — clean.
  • node --test src/features/mesh-compute/classifyModelRef.test.mjs — 10/10 pass (was 4 fewer, now includes file:// and ../ shape coverage).
  • pnpm build:e2e — clean.
  • pnpm exec playwright test tests/e2e/mesh-compute.spec.ts — 2/2 pass; smoke test's copy assertion matches the new text.

Files

  • desktop/src/features/mesh-compute/classifyModelRef.ts — remove local-path variant; treat local-path input as unknown.
  • desktop/src/features/mesh-compute/classifyModelRef.test.mjs — update expectations, expand coverage to file:// and ../.
  • desktop/src/features/mesh-compute/ui/MeshComputeSettingsCard.tsx — copy.
  • desktop/tests/e2e/mesh-compute.spec.ts — copy assertion.

The Share compute UI advertised "enter a model reference or local file" and
`classifyModelRef` had a `local-path` branch. But the pinned mesh-llm SDK
at v0.74.0 only knows two `ExactModelRef` variants — `Catalog` and
`HuggingFace` — so every local path routed through `mesh_start_node` fails
with "Expected an exact model ref" (issue block#4049, sub-issue 2 of 2).

Two-part fix:

1. **Copy.** Drop "or local file" from the descriptive text and add
   "local files are not supported yet" so the form no longer promises a
   capability we cannot deliver.

2. **Validator.** Remove the `local-path` branch from `classifyModelRef`;
   local-path inputs (`/`, `./`, `../`, `~`, `.gguf`, `file://`) now classify
   as `unknown`, which keeps the Share button disabled with a clear UI-level
   signal instead of running and dumping a cryptic SDK error at the user.

Classifier doc comment explains the SDK constraint and points reclassification
at the SDK gaining a `LocalPath` variant.

Tests updated: classifier unit tests assert `unknown` for all path shapes
(plus `file://` and `../` for completeness); Playwright e2e copy assertion
matches the new text. Local verification: 10/10 node-test pass; tsc clean;
2/2 playwright mesh-compute smoke pass.

Partial fix for block#4049. The other half — the underlying ~70 MB layer-download
stall inside the vendored mesh-llm download loop — is a separate,
SDK-side investigation and is explicitly left out of scope here.

Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in>
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.

1 participant