Skip to content

Salvage safe bits from reverted MoA PR (#820) - #824

Merged
michaelneale merged 1 commit into
mainfrom
salvage/moa-820-safe-bits
Jun 11, 2026
Merged

Salvage safe bits from reverted MoA PR (#820)#824
michaelneale merged 1 commit into
mainfrom
salvage/moa-820-safe-bits

Conversation

@michaelneale

@michaelneale michaelneale commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Re-applies the isolated, low-risk improvements from #820 without the MoA fanout/context changes that hung the mesh route (reverted in #823).

What users get

  • New model recommendation: Gemma-4-E4B-it added to the catalog (with vision mmproj) and used as the 8–24GB auto-pack default instead of Qwen3-8B — a stronger mini-class default.
  • Context length fix: peers now correctly report advertised context length when the routable (public) model name differs from the served runtime model name.
  • Touch tooltips: hover tooltips are disabled on touch / coarse-pointer devices so they don't get stuck open.

What was deliberately left out

The MoA pieces suspected of causing the mesh-route hang are not included:

  • mesh-mixture-of-agents/src/* (context, fanout, worker, arbiter, reducer, session, normalize)
  • network/openai/moa_gateway/* (context_budget, context_selection, progress)
  • openai-frontend/responses.rs, network/openai/transport.rs
  • mesh-llm-guardrails/src/rescue.rs (wired into the MoA tool-call path)

These need a real multi-node retest (the hang only reproduced against the live relay-heavy mesh, not CI sim tests) before re-merging.

Validation

  • cargo check -p mesh-llm-host-runtime -p mesh-llm-client -p mesh-llm-node — clean
  • cargo test --lib auto_pack (host + client) — green
  • UI npm run typecheck — clean

Background

#820 was reverted in #823 after it hung the mesh/MoA route in production (verified via Fly v85 works / v86 hangs); console is currently on the v85 rollback.

Summary by CodeRabbit

  • New Features

    • Added Gemma-4-E4B-it-Q4_K_M model to available options.
    • Improved automatic model selection for 8–24GB VRAM systems.
  • Bug Fixes

    • Fixed tooltip rendering on touch-based devices.

Re-applies the isolated, low-risk improvements from #820 without the MoA
fanout/context changes that hung the mesh route:

- catalog.json (node + client): add Gemma-4-E4B-it model entry (with vision
  mmproj) as a strong mini-class default.
- nostr.rs (host + client): use Gemma-4-E4B-it as the 8-24GB auto-pack tier
  default instead of Qwen3-8B; update auto-pack tests accordingly.
- mesh/mod.rs: advertised_context_length now falls back through
  public-model-id -> runtime-model-name resolution so context length is found
  when the routable model name differs from the served runtime name.
- ui/tooltip.tsx: disable hover tooltips on touch/coarse-pointer devices via
  a matchMedia-backed useSyncExternalStore hook.

Deliberately excludes the MoA gateway/context/fanout/reducer/rescue changes
and openai-frontend transport/responses changes, which are the suspected
cause of the mesh-route hang and need a real multi-node retest before
re-merging.
Copilot AI review requested due to automatic review settings June 11, 2026 02:45
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e4aebd8d-daf7-43cd-9330-a3dfed39178d

📥 Commits

Reviewing files that changed from the base of the PR and between 6315858 and e793907.

📒 Files selected for processing (6)
  • crates/mesh-client/src/models/catalog.json
  • crates/mesh-client/src/network/nostr.rs
  • crates/mesh-llm-host-runtime/src/mesh/mod.rs
  • crates/mesh-llm-host-runtime/src/network/nostr.rs
  • crates/mesh-llm-node/src/catalog.json
  • crates/mesh-llm-ui/src/components/ui/tooltip.tsx

📝 Walkthrough

Walkthrough

The PR adds Gemma-4-E4B-it-Q4_K_M model support across mesh-client and mesh-llm-host-runtime, updates automatic model pack selection for 8-24GB VRAM systems to prefer this model, enhances context length resolution with descriptor-based fallback lookup, and implements touch device detection to disable tooltips on coarse-pointer interfaces.

Changes

Gemma-4 Model Integration

Layer / File(s) Summary
Model catalog registration
crates/mesh-client/src/models/catalog.json, crates/mesh-llm-node/src/catalog.json
Gemma-4-E4B-it-Q4_K_M is added to both catalog JSON files with GGUF download URL, model size, description, and associated mmproj metadata.
Model pack tier selection and tests
crates/mesh-client/src/network/nostr.rs, crates/mesh-llm-host-runtime/src/network/nostr.rs
auto_model_pack for both client and host-runtime now maps the 8-24GB VRAM tier to Gemma-4-E4B-it-Q4_K_M, with tier documentation updated and unit tests adjusted to assert the new model selection for 8GB and 16GB single-model configurations.
Context length lookup with fallback
crates/mesh-llm-host-runtime/src/mesh/mod.rs
PeerInfo::advertised_context_length gains a fallback lookup path that derives routable model IDs from served_model_descriptors when direct runtime model lookup fails; an internal helper encapsulates the direct served_model_runtime lookup.

Touch Device Tooltip Handling

Layer / File(s) Summary
Media query-driven tooltip disabling
crates/mesh-llm-ui/src/components/ui/tooltip.tsx
Tooltip component imports useSyncExternalStore and implements (hover: none), (pointer: coarse) media query detection via matchMedia with modern and legacy event listener support; when query matches, Tooltip renders children directly without Radix tooltip wrapper.

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 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 accurately describes the main objective of the PR: re-applying isolated, safe changes from a reverted PR while excluding problematic MoA-related changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 salvage/moa-820-safe-bits

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

Copilot AI 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.

Pull request overview

Re-applies a small set of previously-reverted improvements: updates the recommended mid-tier model selection, fixes peer-advertised context length reporting when public vs runtime model names differ, and disables hover tooltips on touch/coarse-pointer devices to avoid “stuck” tooltips.

Changes:

  • Add Gemma-4-E4B-it-Q4_K_M (with mmproj sidecar) to both node + client bundled catalogs and make it the 8–24GB auto-pack default.
  • Fix PeerInfo::advertised_context_length() to resolve context length for public/routable model IDs that alias a different runtime-served model name.
  • Disable Radix hover tooltips on touch/coarse-pointer devices using useSyncExternalStore + matchMedia.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/mesh-llm-ui/src/components/ui/tooltip.tsx Disables hover tooltips on touch/coarse-pointer devices via media-query subscription.
crates/mesh-llm-node/src/catalog.json Adds Gemma-4-E4B-it quant + mmproj to the node catalog.
crates/mesh-llm-host-runtime/src/network/nostr.rs Switches 8–24GB auto-pack default to Gemma and updates corresponding unit tests.
crates/mesh-llm-host-runtime/src/mesh/mod.rs Fixes context-length lookup to work when a public model name aliases a different runtime model name.
crates/mesh-client/src/network/nostr.rs Switches 8–24GB auto-pack default to Gemma and updates corresponding unit tests.
crates/mesh-client/src/models/catalog.json Adds Gemma-4-E4B-it quant + mmproj to the client catalog.

Comment on lines 1295 to 1299
Pack {
min_vram: 8.0,
models: vec![catalog_ref("Qwen3-8B-Q4_K_M")],
models: vec![catalog_ref("Gemma-4-E4B-it-Q4_K_M")],
},
Pack {
Comment on lines 1854 to +1869
pub fn advertised_context_length(&self, model: &str) -> Option<u32> {
self.advertised_context_length_for_runtime_model(model)
.or_else(|| {
self.served_model_descriptors
.iter()
.filter(|descriptor| {
let runtime_name = descriptor.identity.model_name.as_str();
runtime_name != model
&& self.public_model_id_for_routable_model(runtime_name) == model
})
.find_map(|descriptor| {
self.advertised_context_length_for_runtime_model(
&descriptor.identity.model_name,
)
})
})
@michaelneale
michaelneale merged commit 57a3c24 into main Jun 11, 2026
26 checks passed
@michaelneale
michaelneale deleted the salvage/moa-820-safe-bits branch June 11, 2026 03:36
michaelneale added a commit that referenced this pull request Jun 11, 2026
* origin/main:
  Salvage safe bits from reverted MoA PR (#820) (#824)
  Revert "Stabilize mesh MoA context and tool loops (#820)" (#823)
  Stabilize mesh MoA context and tool loops (#820)
  chore: flip docs pages to canonical URLs (#822)
  chore: Console public domain (#821)
  Add meshllm.cloud website, catalog viewer, and onboarding docs (#806)

# Conflicts:
#	docs/index.html
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