Conversation
…nce cache Agents running in mentions mode required a `p` tag even in DM channels — both in the relay REQ filter (#p) and the local rule check. Desktop auto-tags agent DMs, but mobile only tags explicit @name mentions, so plain DMs sent from mobile were silently dropped and agents appeared unresponsive. A DM addresses the agent implicitly: channels of type "dm" now skip the mention requirement (mentions mode only; startup discovery and dynamically added channels alike, fail-closed on type lookup errors). Also seed the mobile presence cache with a one-shot POST /query fetch per newly tracked pubkey (and on reconnect). Without it, everyone read as offline until their next live kind:20001 event — up to 60s for agents, or never for users who published before the client connected. Synthesized presence events are relay-signed with the subject in the `p` tag; the handler supports both shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
#4201 is the more concise and consistent fix for this, isn't it? |
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
Agents running
buzz-acpin mentions mode require aptag on every message — including in DM channels, at two layers: the relay REQ subscription includes#p, andfilter::match_eventre-checks the mention locally. The desktop composer auto-adds the agentptag in agent DMs, but the mobile composer only tags explicit@namementions. Result: a plain DM sent from mobile never reaches the agent (the relay never delivers it), the agent stays silent, and users conclude the agent is offline.Separately, the mobile presence cache had no initial fetch (
track()was a no-op) — every user and agent read as offline until their next live kind:20001 event arrived, up to 60s for agents publishing heartbeats and indefinitely for users who published before the client connected.Diagnosed on a live deployment: the same agent answered desktop DMs (p-tagged) within seconds while an untagged mobile DM sat unanswered for two days.
Fix
buzz-acp — DM channels (
channel_type == "dm") are exempt from the mention gate; a DM addresses the agent implicitly:resolve_channel_filterstakes the set of DM channel ids and dropsrequire_mentionfor them (mentions mode only; All/Config modes unchanged)resolve_dynamic_channel_filtertakesis_dm; the membership-notification path looks the type up viadiscover_channels(), fail-closed to mention-required on lookup errorsfilter::match_eventtakesmention_exemptand skips the p-tag check for DM channelsmobile —
PresenceCacheNotifier.track()now issues a one-shotPOST /query(kinds[20001], authors = newly tracked pubkeys); the relay synthesizes presence from its store as relay-signed events with the subject in theptag, and the handler supports both that shape and live self-signed events. Tracked pubkeys are re-fetched on (re)connect.Testing
cargo test -p buzz-acp --lib: 819 passed after merging currentmain(3 new: DM exemption in static resolution, dynamic resolution, andmatch_event)cargo clippy -p buzz-acp --all-targets: cleanflutter test(mobile): 1525 passed (2 new: bridge-seeded fetch incl. filter shape, no refetch of already-tracked pubkeys)flutter analyze: no issuesptag → agent responds within one turn; group channels still require@mention🤖 Generated with Claude Code