Skip to content

fix(mesh): dedupe models + retry throttled startup channel discovery#2063

Open
micspiral wants to merge 2 commits into
mainfrom
fix/mesh-runtime-self-heal-and-egress
Open

fix(mesh): dedupe models + retry throttled startup channel discovery#2063
micspiral wants to merge 2 commits into
mainfrom
fix/mesh-runtime-self-heal-and-egress

Conversation

@micspiral

@micspiral micspiral commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two related mesh / shared-compute agent fixes.

1. Dedupe mesh models across @main / plain id forms (e116b80e)

A serving node advertises the same model under two id strings —
unsloth/gemma-4-E4B-it-GGUF@main:Q4_K_M (serve target) and
unsloth/gemma-4-E4B-it-GGUF:Q4_K_M (available_models). dedupe_models
keyed on the raw id, so both survived and the picker showed the model
twice. Fix canonicalizes the id (strips @main) in dedupe_models, matching
the selection-time logic that already did this. Regression test added.

2. Retry startup channel discovery on empty result (3777109b)

A rate-limited relay answers the startup membership query with an empty
result (not an error) — e.g. when many agents connect at once and self-throttle
it. Treating that first empty answer as final left the agent subscribed to
zero channels: it never received a mention, never posted the 👀 ack, and sat
idle until manual restart.

Fix retries discover_channels a few times (5/10/15/20/25s) while the result is
empty before proceeding, riding out the transient throttle. A genuinely
channel-less agent just retries then proceeds (harmless). Scoped to the single
startup call site — no event-loop changes.

Testing

  • cargo fmt / cargo clippy clean; 530 buzz-acp unit tests pass.
  • Model dedup: regression test + 15 model tests green.
  • Startup-retry: verified headless that discovery + subscribe work against a live
    relay; the retry path itself guards an intermittent relay throttle (empty-result
    case) that can't be forced deterministically.

Not covered

  • Outbound reply-publish throttling (relay rate-limits the reply event itself
    under heavy multi-agent load) is a separate issue, not addressed here.

A serving node advertises the same model under two id strings —
`org/model@main:Q4` (serveTargets[].modelId) and `org/model:Q4`
(available_models). `dedupe_models` keyed on the raw id, so BOTH survived
and the model picker listed the same model twice.

The `@main` ref-qualifier was already stripped at selection time
(`pick_serve_target_for_model`), so picking worked — but the display dedup
was never canonicalized, leaving the duplicate in the list.

Canonicalize `@main` once in `dedupe_models` (shared helper
`canonical_model_id`) so both forms collapse to a single entry. Adds a
regression test with the exact two-string shape.
@micspiral
micspiral requested a review from a team as a code owner July 18, 2026 01:58
A rate-limited relay answers the startup membership query with an empty
result (not an error) — e.g. when many agents connect at once and
self-throttle it. Treating that first empty answer as final left the
agent subscribed to zero channels: it never received a mention, never
posted the 👀 ack, and sat idle until manual restart.

Retry discover_channels a few times (5/10/15/20/25s) while the result is
empty before proceeding, riding out the transient throttle. A genuinely
channel-less agent just retries then proceeds (harmless). Scoped to the
single startup call site — no event-loop changes.
@micspiral micspiral changed the title fix(desktop): dedupe mesh models across @main/plain id forms fix(mesh): dedupe models + retry throttled startup channel discovery Jul 18, 2026
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