fix(mesh): dedupe models + retry throttled startup channel discovery#2063
Open
micspiral wants to merge 2 commits into
Open
fix(mesh): dedupe models + retry throttled startup channel discovery#2063micspiral wants to merge 2 commits into
micspiral wants to merge 2 commits into
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) andunsloth/gemma-4-E4B-it-GGUF:Q4_K_M(available_models).dedupe_modelskeyed on the raw id, so both survived and the picker showed the model
twice. Fix canonicalizes the id (strips
@main) indedupe_models, matchingthe 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_channelsa few times (5/10/15/20/25s) while the result isempty 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 clippyclean; 530 buzz-acp unit tests pass.relay; the retry path itself guards an intermittent relay throttle (empty-result
case) that can't be forced deterministically.
Not covered
under heavy multi-agent load) is a separate issue, not addressed here.