Add embedded SDK knobs: disable iroh relays + join-token on running node - #782
Merged
michaelneale merged 1 commit intoJun 2, 2026
Conversation
tlongwell-block
force-pushed
the
tyler/mesh-disable-iroh-relays
branch
from
June 2, 2026 18:43
94c46d7 to
999e394
Compare
Two opt-in seams the Sprout v1 mesh integration needs: - disable_iroh_relays(bool): when true, embedded runtime selects an explicitly disabled relay policy, which uses RelayMode::Disabled, skips public relay URL fallback, skips raw STUN, and avoids the 5s endpoint.online() wait that cannot succeed without a home relay. Default false preserves existing behavior. - EmbeddedNodeHandle::join_token(token): forwards an invite token over the runtime control channel to node.join_with_retry so an already-running embedded node can dial a new EndpointAddr without restart. Handled in both auto and passive/client runtime loops. Purely additive; existing defaults and startup join_tokens behavior remain unchanged. Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Perci <5a968df9a7494b4e019b9ecf739e088ba61097b4312124e9a88ae5b42e3f5f3e@sprout-oss.stage.blox.sqprod.co>
tlongwell-block
force-pushed
the
tyler/mesh-disable-iroh-relays
branch
from
June 2, 2026 19:20
999e394 to
bc2f110
Compare
ndizazzo
requested changes
Jun 2, 2026
ndizazzo
left a comment
Collaborator
There was a problem hiding this comment.
Hey @tlongwell-block 👋🏻 good to see you here, and thanks for the PR!
I had a look at the PR and it looks sane. There's been some back and forth in Discord on some node discoverability issues, so I was looking @ this from the critical lens of mDNS and local-only hosting, and spotted a potential issue...
ExplicitlyDisabled.uses_raw_stun() -> true means that mDNS/LAN-only mode would let mesh do STUN when we'd want that disabled. The smallest fix could be to keep mDNS/LAN precedence over disable_iroh_relays, since you'd not be enabling LAN for Sprout anyways. Mind adding a case to cover that edge and a switch over the relay policy order?
Collaborator
|
@ndizazzo I think this may be ok |
michaelneale
merged commit Jun 2, 2026
ffb8d32
into
Mesh-LLM:micn/sprout-embedded-serve-sdk
1 check failed
i386
added a commit
that referenced
this pull request
Jun 3, 2026
* a run at SDK, tested with a client * Use in-process shutdown for embedded SDK * Satisfy clippy for embedded shutdown plumbing * Document embedded Rust SDK usage * Add public Rust SDK crate * Tighten embedded SDK lifecycle * Address embedded SDK review feedback * Document native runtime packaging direction * Document runtime CLI namespace * Document runtime CLI UX expectations * Document runtime diagnostics under doctor * Add Windows PowerShell installer * Document recommended runtime install flow * Add native runtime resolver foundation * Wire native runtime release installs * Document native runtime crate * Load versioned native runtimes dynamically * Fix embedded SDK output manager reset * Expose SDK mesh admission controls * Split SDK runtime mapping assertions * Tighten SDK docs and config module * Clarify native runtime SDK TODOs * Stabilize native log note test * Expose native runtime install SDK * Re-export native runtime APIs from SDK crate * Add embedded SDK knobs for Sprout relay mesh (#782) Two opt-in seams the Sprout v1 mesh integration needs: - disable_iroh_relays(bool): when true, embedded runtime selects an explicitly disabled relay policy, which uses RelayMode::Disabled, skips public relay URL fallback, skips raw STUN, and avoids the 5s endpoint.online() wait that cannot succeed without a home relay. Default false preserves existing behavior. - EmbeddedNodeHandle::join_token(token): forwards an invite token over the runtime control channel to node.join_with_retry so an already-running embedded node can dial a new EndpointAddr without restart. Handled in both auto and passive/client runtime loops. Purely additive; existing defaults and startup join_tokens behavior remain unchanged. Co-authored-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Perci <5a968df9a7494b4e019b9ecf739e088ba61097b4312124e9a88ae5b42e3f5f3e@sprout-oss.stage.blox.sqprod.co> * Fix relay policy test visibility * Make SDK publishable and align language bindings (#771) * Split SDK native runtime publish surface * Split CLI and TUI support crates * Move CLI parser surface into mesh-llm-cli * Extract shared mesh event surface * Move standalone command handlers out of host runtime * Move benchmark and plugin commands out of host runtime * Finish plugin command extraction * Extract auth identity ownership * Move remaining standalone commands out of host runtime * Move model store into model-hf * Move CLI commands out of host runtime * Decouple host runtime from CLI and TUI crates * Expose embedded node SDK facade * Keep client identity dependencies pure * Simplify Rust SDK feature surface * Keep SDK client feature runtime-free * Expose SDK client API base override * Use direct mesh SDK client transport * Remove API base URL client builder shim * Align language SDKs with Rust SDK facade * Document SDK client and serving modes * Fix SDK smoke runtime setup * Package SDK console assets * Fix dynamic runtime CI setup * Restructure SDK docs by language * Fix SDK smoke package loading * Fix native runtime bundle resolution * Add structured native runtime backend metadata * Harden Kotlin native runtime smoke resolution * Fix mesh-llm-sdk clippy imports * Retry smoke model downloads --------- Co-authored-by: James Dumay <jameswdumay@gmail.com> Co-authored-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com> Co-authored-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Perci <5a968df9a7494b4e019b9ecf739e088ba61097b4312124e9a88ae5b42e3f5f3e@sprout-oss.stage.blox.sqprod.co>
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.
What
Two opt-in, default-false seams the Sprout v1 mesh integration needs on the embedded SDK:
disable_iroh_relays(bool)— when true,bind_mesh_endpointusesRelayMode::Disabledinstead of the existingRelayMode::Custompath. Lets a consumer say "no public relay" explicitly; today an empty relay list silently falls back to public*.iroh.link. Defaultfalsepreserves existing behavior byte-for-byte.EmbeddedNodeHandle::join_token(token)— forwards an invite token over the existingRuntimeControlchannel tonode.join_with_retry, so an already-running embedded node can dial a newEndpointAddrwithout restart (the call-me-now primitive).Purely additive. Defaults preserve current behavior for all other consumers. +87/−9 across 6 files.
Base
This PR targets
micn/sprout-embedded-serve-sdk(the branch behind #736), notmain. The knobs extend thecrates/mesh-llm-sdkcrate, which only exists on the #736 stack — it is not onmainyet. A PR againstmainwould be unreviewable noise (the whole SDK stack would show as the diff). This is a dependent PR; it should land after / with #736.Verification
cargo check -p mesh-llm-sdk --features client,servegreen. Consumed and exercised in Sprout's desktop mesh integration (relay-gated discovery → connect → call-me-now → inference).Co-authored with Max (Sprout team).
Connectivity: WAN via STUN, relay transport off
disable_iroh_relays(true)→RelayPolicy::ExplicitlyDisabledturns off the iroh relay transport (no*.iroh.linktraffic) but keeps raw STUN on (uses_raw_stun()matchesDefaultPublic | ExplicitlyDisabled). The STUN-discovered public address is injected into the invite token /EndpointAddr, so a relay-signaled peer can hole-punch directly over WAN without an iroh relay. STUN is a "what's my public IP" lookup, not a data path — the privacy posture (no relay traffic) holds.Disabled(LAN-only mDNS mode) stays STUN-off, intentionally.Residual limit: no relay transport fallback, so two peers both behind symmetric NATs may fail to hole-punch (the case iroh relays normally cover). Fine for the common cases (≥1 side cone-NAT/forwarded/server). (Reviewed by Perci.)