feat(nodes): hold node pairings in several workspaces at once (0.2.166) - #613
Merged
Merged
Conversation
The node row is per (workspace, device), so one machine legitimately belongs to several workspaces — but node.json only ever described one. Pairing a second workspace overwrote the first, and the daemon heartbeated whichever pairing happened to be on top, so every other workspace's "connected devices" view went stale. node-config now owns a pairing list: listPairings() (reconstructing a single top-level pairing for records written before it existed), recordPairing() which adds or refreshes one without disturbing the others, and clearPairing(workspaceId) replacing clearActivePairing(). The newest pairing is still mirrored at the top level, so a daemon predating multi-pairing keeps working. The daemon heartbeats every pairing concurrently, each with its own WorkspaceClient (cached per workspace_id) and its own roster scoped to that workspace's agents. One unreachable workspace no longer stops the others from reporting; a 404 clears only that pairing; and a remote command's result is reported back over the client of the workspace that issued it, never another one's. `agn node connect` records additively and `agn node status` lists every workspace the device belongs to. Includes the two core commits this builds on that had not reached develop yet (roster/command scoping to the connected workspace, and clearing a removed node's pairing on a heartbeat 404), and keeps the 0.2.165 Windows console-window fix intact. Version bump so the daemon actually picks this up; the launcher's bundled dependency follows separately once this is published.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Ashin-LX-98
added a commit
that referenced
this pull request
Aug 13, 2026
The core side of multi-workspace pairing landed on develop as its own release (0.2.166, #613), so the four agent-connector files conflicted with the copies this branch still carried. develop's version is the one that shipped — it holds the same pairing work plus the 0.2.165 Windows console fix — so it wins outright here and packages/agent-connector on this branch is now identical to develop.
Ashin-LX-98
added a commit
that referenced
this pull request
Aug 13, 2026
The core side of multi-workspace pairing landed on develop as its own release (0.2.166, #613), so the four agent-connector files conflicted with the copies this branch still carried. develop's version is the one that shipped — it holds the same pairing work plus the 0.2.165 Windows console fix — so it wins outright here and packages/agent-connector on this branch is now identical to develop.
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.
为什么
node 行是按 (workspace, device) 建的,一台设备本来就可以同时属于多个 workspace —— 但
node.json只描述得了一个。配对第二个 workspace 会把第一个覆盖掉,daemon 也只给"排在最上面"的那个发心跳,于是其它 workspace 的"已连接设备"视图就一直是旧的。改了什么
node-config.js改成维护一份配对列表listPairings()—— 旧格式(只有顶层单条配对)会被重建成列表,向后兼容recordPairing()—— 新增或刷新一条,不动其它配对clearPairing(workspaceId)—— 取代clearActivePairing(),只丢掉指定的那条daemon.js按配对逐个心跳WorkspaceClient(按workspace_id缓存),roster 也按该 workspace 的 agent 过滤cli.jsagn node connect改为增量记录agn node status列出设备所属的全部 workspace说明
feat/launcher-node-pairing上两个还没进 develop 的 core commit(roster/命令按已连接 workspace 收敛、心跳 404 清配对),因为本次改动直接建在它们之上。验证
node --test(CI 那条命令,排除 mini):935 tests / 933 pass / 2 skipped / 0 fail。agn node status与require('./src/index.js')冒烟通过。🤖 Generated with Claude Code