Skip to content

feat(nodes): hold node pairings in several workspaces at once (0.2.166) - #613

Merged
Ashin-LX-98 merged 1 commit into
developfrom
feat/core-multi-workspace-pairing
Aug 13, 2026
Merged

feat(nodes): hold node pairings in several workspaces at once (0.2.166)#613
Ashin-LX-98 merged 1 commit into
developfrom
feat/core-multi-workspace-pairing

Conversation

@Ashin-LX-98

Copy link
Copy Markdown
Collaborator

为什么

node 行是按 (workspace, device) 建的,一台设备本来就可以同时属于多个 workspace —— 但 node.json 只描述得了一个。配对第二个 workspace 会把第一个覆盖掉,daemon 也只给"排在最上面"的那个发心跳,于是其它 workspace 的"已连接设备"视图就一直是旧的。

改了什么

node-config.js 改成维护一份配对列表

  • listPairings() —— 旧格式(只有顶层单条配对)会被重建成列表,向后兼容
  • recordPairing() —— 新增或刷新一条,不动其它配对
  • clearPairing(workspaceId) —— 取代 clearActivePairing(),只丢掉指定的那条
  • 最新的配对仍然镜像在顶层字段上,所以早于多配对的 daemon 照常工作

daemon.js 按配对逐个心跳

  • 每条配对一个 WorkspaceClient(按 workspace_id 缓存),roster 也按该 workspace 的 agent 过滤
  • 并发发送、失败按配对隔离:某个 workspace 不可达不会拖住其它的
  • 404 只清掉那一条配对
  • 远程命令的结果回报走"下发该命令的那个 workspace"的 client,不会串到别的

cli.js

  • agn node connect 改为增量记录
  • agn node status 列出设备所属的全部 workspace

说明

  • 这个分支同时带上了 feat/launcher-node-pairing 上两个还没进 develop 的 core commit(roster/命令按已连接 workspace 收敛、心跳 404 清配对),因为本次改动直接建在它们之上。
  • 0.2.165 的 Windows 控制台窗口修复原样保留。
  • 版本 0.2.165 → 0.2.166,daemon 需要发包才能拿到;launcher 的 bundled 依赖等发布后另外提。

验证

node --test(CI 那条命令,排除 mini):935 tests / 933 pass / 2 skipped / 0 fail。agn node statusrequire('./src/index.js') 冒烟通过。

🤖 Generated with Claude Code

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.
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openagents-workspace Ready Ready Preview Aug 13, 2026 8:12am

Request Review

@Ashin-LX-98
Ashin-LX-98 merged commit 0bdd485 into develop Aug 13, 2026
14 checks passed
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.
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.

1 participant