Skip to content

feat(core): gossip this side's own agent identity and merge discoveries into listAgents - #139

Merged
Mearman merged 1 commit into
mainfrom
feat/agent-discovery-gossip
Sep 16, 2026
Merged

Mearman merged 1 commit into
mainfrom
feat/agent-discovery-gossip

Conversation

@Mearman

@Mearman Mearman commented Sep 16, 2026

Copy link
Copy Markdown
Member

WireMeshTransport's gossip tick gains a third optional source (getSelfAgentAdvert), gossiping this side's own name/harness/cwd/pid/startedAt/tags/subscribedRooms under agent/self -- the write half of P3.8's eventual agent register/update/offline retirement (agent-comms#48). Deliberately excludes status (already carried separately under presence/status, no need to duplicate) and visibility (only ever populated for a "visible" agent in the first place, so a discovered entry's visibility is always exactly "visible" by construction).

MeshStore.selfAgentAdvert reads this store's own agent record and withholds the advert entirely for anything other than "visible" -- gossip reaches every connected peer regardless of mesh-approval status (quarantined connections observe gossip too, per wire-mesh-transport.ts's own allSessions comments), so advertising a hidden or ghost agent's identity this way would leak exactly what those visibility levels exist to withhold.

AgentRegistry.listAgents merges in a gossip-discovered agent not otherwise locally known, mirroring listRooms' own room-discovery merge (#138) closely: a display-only placeholder AgentIdentity built from the gossiped advert, status read from the existing presence/status key rather than duplicated, never merged into the local agents map, and always shadowed by a real local record when one exists.

Tested at both layers: a real two-transport integration test proving the gossip write side actually reaches a peer's listKnownDevices, and a fake-harness AgentRegistry test proving the merge (including the shadow-a-known-agent and no-capability cases) -- confirmed the merge test can actually fail (temporarily emptied the discovery loop, watched it fail for the right reason, reverted) before trusting the green run.

Refs #48.

…es into listAgents

WireMeshTransport's gossip tick gains a third optional source
(getSelfAgentAdvert), gossiping this side's own name/harness/cwd/pid/
startedAt/tags/subscribedRooms under agent/self -- the write half of
P3.8's eventual agent register/update/offline retirement. Deliberately
excludes status (already carried separately under presence/status)
and visibility (only ever populated for a "visible" agent in the
first place, so a discovered entry's visibility is always exactly
"visible" by construction).

MeshStore.selfAgentAdvert reads this store's own agent record and
withholds the advert entirely for anything other than "visible" --
gossip reaches every connected peer regardless of mesh-approval
status, so advertising a hidden or ghost agent's identity this way
would leak exactly what those visibility levels exist to withhold.

AgentRegistry.listAgents merges in a gossip-discovered agent not
otherwise locally known, mirroring listRooms' own room-discovery
merge (#138): a display-only placeholder AgentIdentity, real facts
from the gossiped advert, status read from the existing presence/
status key, never merged into the local agents map, and always
shadowed by a real local record when one exists.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-16T03:42:42.517163Z 8b23de2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman
Mearman merged commit 1fe110f into main Sep 16, 2026
6 checks passed
@Mearman
Mearman deleted the feat/agent-discovery-gossip branch September 16, 2026 03:43
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.28.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant