feat(relay): auto-add relay owner to newly created channels - #4495
Open
wilsonwang0713 wants to merge 1 commit into
Open
feat(relay): auto-add relay owner to newly created channels#4495wilsonwang0713 wants to merge 1 commit into
wilsonwang0713 wants to merge 1 commit into
Conversation
Add BUZZ_AUTO_ADD_OWNER_TO_CHANNELS (default off). When enabled, the relay owner (RELAY_OWNER_PUBKEY) is automatically enrolled as an admin member of every channel they did not create, so the owner's channel list stays in sync with agent- and member-created channels without a manual join. The enrollment runs in handle_create_group before NIP-29 discovery emission, so the kind:39002 members roster already includes the owner, and emits a member-added notification so the owner's client subscribes in real time. Idempotent and non-fatal: the channel and creator membership are already committed if the owner add fails. Signed-off-by: wilson <wilson07131@gmail.com>
wilsonwang0713
force-pushed
the
feat/auto-add-owner-to-created-channels
branch
from
August 7, 2026 01:47
a34c70b to
675ea4e
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.
Problem
When an agent (or another member) creates a channel, only the creator becomes a member. The relay owner does not see the new channel in their client until they manually join — and for private channels they cannot self-join at all (kind:9021 is open-channel only). This is especially confusing with agent-created channels: the agent reports "created", but the owner's channel list stays empty.
Change
Add
BUZZ_AUTO_ADD_OWNER_TO_CHANNELS(default off). When enabled andRELAY_OWNER_PUBKEYis set, the relay owner is automatically enrolled as anadminmember of every channel they did not create.handle_create_group, before NIP-29 discovery emission, so the kind:39002 members roster already includes the owner.Testing
auto_add_owner_to_channels_defaults_off_and_opts_in(default off; opt-in on).cargo fmt,cargo clippy -p buzz-relay, andcargo build -p buzz-relaypass.deploy/composerelay: an agent-created channel appears for the owner within the same turn, no manual join.Notes
Opt-in and default-off, so existing single- and multi-tenant deployments are unaffected unless they explicitly enable it.