Repository navigation
Persist manual nodes in the broker - #32
Merged
Merged
Conversation
nvpair-manual-nodes keeps its entries in memory, and the desktop app owned the only durable copy, replaying it after the broker came up. A manual-nodes worker restarted by the broker (after a crash or a hang), or a broker driven by the terminal interface, lost every manual node, including the Tailscale and VPN peers that are reachable no other way. The broker now persists successful node/add and node/remove operations to configs/manual-nodes.json in the per-user data directory, the file the desktop already wrote, and replays the entries into every new manual-nodes worker. The desktop's own store and replay are removed: one owner, in the service. Ported from NVIDIA/Personal-AI-Router@aed93b6 (NVIDIA#60), adapted to this fork's broker. (cherry picked from commit aed93b6) Co-authored-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Signed-off-by: Jared Ping <13906915+JaredP94@users.noreply.github.com>
A node/add or node/remove held the mutation lock until the manual-nodes worker answered, and took it on the broker's request loop. A second mutation while the first was unanswered (a hung worker) blocked every broker request, including restart and shutdown, until the worker was restarted. Each mutation now runs in its own goroutine chained behind the previous one, so mutations still apply in the order clients sent them and the request loop never waits. Adds a test for that case and one for loading the file the desktop store used to write. Signed-off-by: Jared Ping <13906915+JaredP94@users.noreply.github.com>
JaredP94
force-pushed
the
fix/broker-manual-nodes
branch
from
November 2, 2026 18:51
0a3d286 to
1a7ee9a
Compare
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.
Description
nvpair-manual-nodeskeeps entries in memory and the desktop owned the only durable copy, replaying it once the broker came up. A manual-nodes worker restarted by the broker (crash or hang) — or any broker driven bynvpair-tui— lost every manual node, including Tailscale/VPN peers reachable no other way.The broker now persists successful
node/add/node/removetoconfigs/manual-nodes.json(the file the desktop already wrote, so existing entries carry over) and replays it into every new manual-nodes worker. The desktop's store and replay are removed — one owner, in the service.Ported from NVIDIA/Personal-AI-Router@aed93b6 (NVIDIA#60), merged with this fork's scheduling-demand push on worker start.
Validation
go test ./...innvpair-ui-broker, including upstream's persistence tests.services/testsbroker management/supervision tests run with an isolatedHOME; my realmanual-nodes.jsonwas verified untouched. (Two manual-bridge tests there fail identically onmain— pre-existing.)typecheck,lint,test:unit,dead-code:check,service-contracts:check.Risk
The on-disk format is the one the desktop already used. ui-broker 2.4.1 → 2.5.0.
Checklist
git commit -s), certifying the Developer Certificate of Origin.services/versions.json, and described user-visible changes above so they reach the release notes.Part of the upstream issue/PR review. Each branch is independent off
main; they all bumpservices/versions.json, so the second one merged will need a trivial conflict resolution there.