Repository navigation
feat(peer): link bots across two daemons - #19
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pair two of the owner's daemons over Tailscale and stand a bot from one in as a linked bot in a project on the other. A linked bot is an ordinary bot row with peer_id set, so addressing, task budgets and history work unchanged; the delivery worker forwards deliveries for it over the /peer link instead of writing to a local session. The receiving daemon stores each forwarded message as if the sender were local: a task is mirrored with the sender's deadline and hop count, a result or cancel closes the mirrored task, and the sender gets a linked bot of its own on first contact so replies route back. Files listed in a result travel with it (from the bot's own directory or the project artifacts only, size-capped) and land in the recipient project's artifacts directory. Pairing is a one-time invite holding a link token bound to the first daemon that presents it. Peers can only list bots, link one, and deliver to bots linked to them; revoking drops the link. `gravityd peer ...` drives pairing and linking until the desktop UI lands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ahilles107
force-pushed
the
codex/peer-bots
branch
from
October 2, 2026 11:02
b9da294 to
e052d4c
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.
What
Lets one Gravity team span two of the owner's machines. For example, a lead and a Mac developer run on a Mac, and a Windows developer runs on a Windows PC. Design:
docs/peer-bots.md./peerroute, and traffic flows both ways over it.botrow withpeer_idset. Addressing,list_bots(now withmachineandonline), task budgets and history all work unchanged. The supervisor never starts a linked bot.taskis mirrored with the sender's deadline and hop count;artifacts/peers/<peer>/. Only files from the bot's own directory or its project's artifacts are sent, capped at 16 MB per file and 48 MB per result.list_peers,create_peer_invite,add_peer,revoke_peer,list_peer_botsandlink_peer_bot.gravityd peer invite|add|list|bots|link|revokedrives pairing and linking until there is UI for it.Why
A cross-platform app needs bots on each platform, and the owner should not have to switch the desktop app between daemons to relay tasks and carry files.
How tested
tests/peer_bots.rsruns two in-process daemons on the runtime double. It covers:cargo fmt,cargo clippy -D warnings, the full workspace tests and the file-length check pass.Rollout
peer,peer_link,peer_messageandpeer_tasktables, plusbot.peer_idandbot.remote_bot_id.gravityd.toml.base64is now a direct dependency ofgravityd; it was already in the lockfile, so only the inventory hashes changed.Limitations
🤖 Generated with Claude Code