feat(buzz-acp): publish the kind:10100 relay-agent directory entry - #6097
Open
Schnitzel wants to merge 1 commit into
Open
feat(buzz-acp): publish the kind:10100 relay-agent directory entry#6097Schnitzel wants to merge 1 commit into
Schnitzel wants to merge 1 commit into
Conversation
A harness-run agent cannot appear in Buzz Desktop's `@` autocomplete today, however healthy it is, and nothing reports why. Desktop builds its mentionable set as managed agents ∪ relay agents (`desktop/src/features/agents/knownAgentPubkeys.ts`). Managed agents are the ones the desktop holds a key for and runs itself, so an agent created in the app qualifies immediately and needs no relay event at all. An agent run by buzz-acp can never be in that set, which leaves the kind 10100 relay-agent directory entry as its only route — and buzz-acp never publishes one. `relayAgentCanRespondInChannel` then fails on an absent `channel_ids`, so the agent is silently offered nowhere. The failure is quiet at every layer: no error client-side, and a mention typed by hand goes out with no `p` tag, so it routes nowhere either. This publishes the entry from state the harness already has — the channels it discovered and subscribed to, plus its own author gate — at startup and again whenever a membership notification changes the channel set. Only subscribed channels are advertised, so the entry never offers a mention the agent would not receive. On membership change the channel set is re-read from the relay rather than trusted from local bookkeeping. Publishing is best-effort: discoverability is never worth failing a startup or dropping a membership update over, so failures are logged and execution continues. Kind 10100 is replaceable, so republishing supersedes rather than accumulating. Two flags, both opt-out/opt-in rather than changing existing behaviour for anyone who already publishes this entry themselves: --no-publish-directory / BUZZ_ACP_NO_PUBLISH_DIRECTORY --display-name / BUZZ_ACP_DISPLAY_NAME `name` is omitted when unset rather than guessed, so clients fall back to the agent's kind:0 profile name and then its npub, as they already do. `respond_to_allowlist` is emitted only in allowlist mode, mirroring the inbound author gate so the people who may prompt an agent are exactly the people whose client offers it. Tests cover the entry body: only subscribed channels are advertised, names stay positionally aligned with ids, the allowlist appears only in allowlist mode, blank names are omitted, and output is stable across builds so a replaceable event is not rewritten without cause. Signed-off-by: Michael Schmid <michael.schmid@amazee.com>
Schnitzel
force-pushed
the
acp/publish-agent-directory
branch
from
August 17, 2026 03:56
1cf0cbf to
203770b
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.
The problem
An agent run by
buzz-acpnever appears in Buzz Desktop's@autocomplete, however healthy it is, and nothing anywhere reports why.Desktop builds its mentionable set as managed agents ∪ relay agents (
desktop/src/features/agents/knownAgentPubkeys.ts):relayAgentCanRespondInChannel— the entry'schannel_idsmust contain the channel being typed in, and itsrespond_tomust admit the person typing.A harness-run agent can never be in the first set, so kind 10100 is its only route.
buzz-acpnever publishes one.channel_idsis then absent,agents_from_eventsdefaults it to[], and the agent is eligible in no channel.The failure is silent end to end: no client-side error, and a mention typed by hand goes out with no
ptag, so it routes nowhere either. From the user's side a perfectly healthy bot simply cannot be mentioned.examples/countdown-bot's README attributes mentionability to therole=botself-add. In testing against a current relay and desktop that was not sufficient on its own; publishing kind 10100 was what made the agent appear.The change
Publishes the entry from state the harness already holds — the channels it discovered and subscribed to, plus its own author gate — at startup, and again whenever a membership notification changes the channel set.
Two new flags, so existing deployments that publish this entry themselves are unaffected:
--no-publish-directoryBUZZ_ACP_NO_PUBLISH_DIRECTORY--display-nameBUZZ_ACP_DISPLAY_NAMEnameis omitted when unset rather than guessed, so clients fall back to the agent's kind:0 profile name and then its npub, as they already do.respond_to_allowlistis emitted only in allowlist mode, mirroring the inbound author gate so the people who may prompt an agent are exactly the people whose client offers it.Testing
buzz-acpsuite: 783 passed, 0 failedcargo clippy -p buzz-acp --all-targetsclean,cargo fmtappliedQuestion for maintainers
Kind 10100 does not appear in any NIP under
docs/nips/, unlike the other agent-facing kinds (NIP-AP, NIP-AE, NIP-AO, NIP-AA). If it is intended to stay an internal convention I am happy to adjust; if it should be specified, I would be glad to draft it. Happy to change the default to opt-in if you would rather this not publish without being asked.