Skip to content

feat: add live directory support for Buzz - #116799

Merged
shakkernerd merged 50 commits into
mainfrom
feat/buzz-directory
Jul 31, 2026
Merged

shakkernerd merged 50 commits into
mainfrom
feat/buzz-directory

Conversation

@shakkernerd

Copy link
Copy Markdown
Contributor

What Problem This Solves

Buzz exposed senders and rooms to OpenClaw primarily through public keys and UUIDs. This made conversations difficult for agents and users to understand, and Buzz did not support OpenClaw’s directory commands for discovering the bot identity, rooms, or room members.

Room profile, membership, and archive changes also needed to remain synchronized without leaking subscriptions, stalling the plugin, or affecting Gateway availability.

Why This Change Was Made

This adds an authenticated, lifecycle-owned Buzz directory backed by relay-signed room metadata, membership events, and member profiles.

The plugin reuses the active Buzz connection when available and uses a bounded temporary connection for standalone directory commands. Subscription counts, profile synchronization, replay dispatch, reconnect history, query duration, and shutdown work are explicitly bounded.

Stable public keys and room UUIDs remain the authorization and routing identities. Profile names, avatars, handles, and room names are presentation metadata only.

Archived rooms are excluded from discovery, directory results, peer snapshots, and live message subscriptions. Membership or archive-state changes rebuild only the affected Buzz connection while the Gateway continues running.

User Impact

Users can now:

  • See recognizable Buzz sender and room names in agent conversation context.
  • Inspect the bot identity with openclaw directory self --channel buzz.
  • Search Buzz members with openclaw directory peers list --channel buzz.
  • Search configured rooms with openclaw directory groups list --channel buzz.
  • List members of a room with openclaw directory groups members.
  • Address a room by a unique current name while retaining buzz:<ROOM_UUID> as the canonical automation target.
  • Receive updated names, memberships, and archive state without restarting the Gateway.

If profile information is unavailable, OpenClaw falls back to deterministic public-key labels without changing sender identity or authorization behavior.

Evidence

  • Passed the complete Buzz test surface: 24 test files and 124 tests.
  • Passed Buzz formatting and lint checks.
  • Verified directory state, relay queries, profile synchronization, membership updates, archived-room handling, subscription budgeting, reconnect behavior, cancellation, and replay bounds.
  • Built and ran the exact branch head through the buzz-fresh OCM environment.
  • Completed a live round trip against the local Buzz relay and received the expected agent response: Shakker, building.
  • Verified the Gateway remained healthy during the live flow and shut down cleanly afterward.
  • Completed an independent final review with no remaining findings.

Not exercised live: a destructive archive-and-restore cycle and a 1,021-room relay stress test. These limits and state transitions are covered by focused automated tests.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: buzz size: XL maintainer Maintainer-authored PR labels Jul 31, 2026
@shakkernerd
shakkernerd force-pushed the feat/buzz-directory branch from dd1abfe to 76a49fa Compare July 31, 2026 11:34
@shakkernerd shakkernerd self-assigned this Jul 31, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 8:32 AM ET / 12:32 UTC.

ClawSweeper review

What this changes

This PR adds relay-backed Buzz directory commands and human-readable sender and room labels, while updating the Buzz connection lifecycle when room membership or archive metadata changes.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for maintainer review. It is a substantial, coherent Buzz-channel feature with no discrete source-level defect established in this review, but it intentionally changes live relay subscriptions and reconnect behavior; the PR body confirms that archive/restore and post-reconnect delivery have not been exercised live. The author is a repository member and the PR carries the protected maintainer label, so it should not be auto-closed.

Priority: P2
Reviewed head: ed8a5e2d7645a70c6f06e4d7ddd0954472636c00
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch has substantial focused coverage and reported live smoke evidence, but its highest-risk archive/restore and reconnect-delivery transition remains unobserved on a real relay.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The contributor is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless reports a live local-relay round trip, while archive/restore and post-reconnect delivery remain unproven live.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The contributor is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless reports a live local-relay round trip, while archive/restore and post-reconnect delivery remain unproven live.
Evidence reviewed 5 items Current PR status: The supplied GitHub state shows this is an open, unmerged PR whose head is ed8a5e2d7645a70c6f06e4d7ddd0954472636c00; there is no evidence that its live-directory behavior is already present in a shipped release.
Lifecycle-sensitive behavior: The branch adds relay directory state, room-membership notifications, subscription budgeting, and reconnect handling; these are directly on the message-processing and Gateway-availability path.
Known live-proof boundary: The PR body reports a successful local relay round trip but explicitly says destructive archive-and-restore and the 1,021-room relay stress path were not exercised live. Those are the paths most relevant to the new connection-rebuild and capacity behavior.
Findings None None.
Security None None.

How this fits together

The Buzz plugin connects an OpenClaw Gateway account to a Buzz relay for room messages and typing updates. This change adds a bounded directory snapshot and live relay subscriptions that feed CLI directory queries and the labels included in inbound agent context.

flowchart LR
  A[Configured Buzz account] --> B[Authenticated Buzz relay]
  B --> C[Directory snapshot and live subscriptions]
  C --> D[Directory CLI commands]
  C --> E[Inbound sender and room labels]
  E --> F[Agent reply through Buzz]
  C --> G[Membership or archive update]
  G --> B
Loading

Decision needed

Question Recommendation
Should this PR require a real-relay archive/restore and post-reconnect reply-delivery proof before merge, or is the focused automated coverage sufficient for the new connection-rebuild behavior? Require targeted real-relay proof: Record a redacted archive/restore flow that shows the Gateway remains healthy and a subsequent Buzz message receives its expected reply.

Why: The branch changes live channel subscription and reconnect behavior; source review and unit coverage cannot by themselves establish the intended user-visible outcome during a real relay state transition.

Before merge

  • Resolve merge risk (P1) - Membership, archive, and stalled-directory events rebuild the active Buzz connection. Until archive/restore and a reply delivered after reconnect are demonstrated against a real relay, maintainers cannot fully assess whether a legitimate in-flight response is intentionally cancelled or unintentionally lost during that transition.
Agent review details

Security

None.

PR surface

Source +1561, Tests +2133, Docs +63. Total +3757 across 38 files.

View PR surface stats
Area Files Added Removed Net
Source 22 1920 359 +1561
Tests 12 2173 40 +2133
Docs 4 66 3 +63
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 38 4159 402 +3757

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: extensions/buzz/src/relay-subscription.test.ts, serialized state: extensions/buzz/src/relay-subscription.ts, vector/embedding metadata: extensions/buzz/src/subscription-budget.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Add real relay lifecycle proof (recommended)
    Before merge, provide redacted evidence of archive/restore followed by successful inbound processing and reply delivery after the Buzz connection rebuilds.
  2. Accept the remaining lifecycle uncertainty
    Maintainers may merge with the focused automated coverage if they explicitly accept the unobserved archive/restore and reconnect-delivery behavior.
  3. Pause for a narrower lifecycle design
    Pause this PR if reconnecting an account-wide Buzz bus on room metadata changes is not the desired delivery contract.

Technical review

Best possible solution:

Land only after the Buzz owner accepts the reconnect contract and either reviews targeted real-relay evidence for archive/restore plus post-reconnect delivery or explicitly accepts the remaining test-backed lifecycle risk.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR adds a new Buzz directory capability rather than reporting a broken established behavior. The PR body supplies a real local-relay round trip, but not live archive/restore evidence.

Is this the best way to solve the issue?

Unclear: using the existing channel-directory SDK is the right boundary, but the account-connection rebuild contract still needs maintainer acceptance or targeted real-relay proof before this can be called the best operational solution.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2d5c24bc297d.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is a useful channel capability with bounded but real user-facing risk around live subscription transitions.
  • merge-risk: 🚨 message-delivery: The branch changes active Buzz subscription and reconnect handling, which can affect replies that overlap a membership or archive update.
  • merge-risk: 🚨 availability: Directory timeouts and room-state changes now recycle a live Buzz connection, so relay behavior can affect channel continuity even while the Gateway remains running.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The contributor is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless reports a live local-relay round trip, while archive/restore and post-reconnect delivery remain unproven live.

Evidence

What I checked:

  • Current PR status: The supplied GitHub state shows this is an open, unmerged PR whose head is ed8a5e2d7645a70c6f06e4d7ddd0954472636c00; there is no evidence that its live-directory behavior is already present in a shipped release. (extensions/buzz/src/directory.ts:1, ed8a5e2d7645)
  • Lifecycle-sensitive behavior: The branch adds relay directory state, room-membership notifications, subscription budgeting, and reconnect handling; these are directly on the message-processing and Gateway-availability path. (extensions/buzz/src/buzz-bus.ts:1, ed8a5e2d7645)
  • Known live-proof boundary: The PR body reports a successful local relay round trip but explicitly says destructive archive-and-restore and the 1,021-room relay stress path were not exercised live. Those are the paths most relevant to the new connection-rebuild and capacity behavior. Public docs: docs/channels/buzz.md. (docs/channels/buzz.md:185, ed8a5e2d7645)
  • Prior review continuity: The previous ClawSweeper cycle found no line-level defects but requested live archive/restore and post-reconnect delivery evidence before release; the current branch adds subscription-capacity reservation but does not supply that missing live lifecycle proof. (extensions/buzz/src/subscription-budget.ts:1, ed8a5e2d7645)
  • Security boundary pass: Relay metadata lookup is routed through the plugin SDK SSRF guard rather than an unrestricted fetch path, and the supplied security checks completed successfully; no concrete security or supply-chain regression was identified. (extensions/buzz/src/relay-auth.ts:1, ed8a5e2d7645)

Likely related people:

  • shakkernerd: The supplied branch history attributes the complete live-directory, relay lifecycle, subscription-budget, and documentation series to this repository member; no separate current-main ownership trail was available in the supplied evidence. (role: recent Buzz directory implementation contributor; confidence: medium; commits: 8d920427ce59, bcea85ced5c2, ed8a5e2d7645; files: extensions/buzz/src/buzz-bus.ts, extensions/buzz/src/directory-state.ts, extensions/buzz/src/relay-auth.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach redacted terminal output or a recording of archive/restore followed by successful post-reconnect message delivery.
  • State the intended treatment of an in-flight reply when a membership or archive event rebuilds the Buzz connection.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-07-31T12:05:44.663Z sha 9108720 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: buzz docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant