feat(relay): notify channel when an offline agent is @mentioned#2296
feat(relay): notify channel when an offline agent is @mentioned#2296Bartok9 wants to merge 3 commits into
Conversation
9daf893 to
359dce5
Compare
|
Blocking evidence against current head Wire-format evidenceCurrent Desktop reply construction always begins with a structural author tag: const tags: string[][] = [
["p", authorPubkey],
["h", channelId],
];See This PR's ingest hook collects every
PR #1862 received this exact review finding and moved toward explicit Required correctionUse an unambiguous explicit-mention signal rather than treating all
Please also document the guarantee accurately: presence is a useful reachability warning, not a delivery receipt proving that a particular harness subscription admitted the event. Separate end-to-end response timing evidence is tracked in #2386; this comment is about notification correctness. |
|
Thanks — this is a fair and precise catch. You're right that intersecting all I'll rework this to key off an unambiguous explicit-mention signal rather than the raw
And I'll fix the docs to frame presence as a reachability warning, not a delivery receipt. E2E timing stays scoped to #2386. Will push the revision. |
Brad review on block#2296: collecting all `p` tags false-positives when buildReplyTags adds a structural reply-author `p` without an @mention. - Extract mentions via tag kind "mention" only (desktop MENTION_REFERENCE_TAG) - Dedup/skip malformed; ignore bare `p` tags - Expand unit matrix for structural-p / online / offline / human / dedup - Document presence as reachability warning, not delivery receipt Refs block#1743 Signed-off-by: Bartok9 <danielrpike9@gmail.com>
359dce5 to
d2cb235
Compare
Revision pushed (Brad blocking review)Head is now rebased on Evidence
Test matrix (unit)All passed locally:
Relation to #1862Focused relay-side notice on explicit cc @BradGroux |
|
The structural-
The Desktop reference is narrower than the revision comment suggests: The added unit tests also stop at extraction and selection. They do not exercise signed event ingest through the spawned side effect, observe exactly one persisted/fanned-out system notice, or inject presence/emit failures to prove the original message remains accepted. To close this cleanly:
I also ran the existing Buzz SDK mention regression at this exact head; it passed and confirms the current builder emits one deduplicated |
|
Confirmed, and thanks for the precise trace — this is a real gap, not wording. I over-corrected. Verified locally:
Plan to close cleanly, matching your four points:
One design check before I push, to avoid a second round: do you prefer the explicit signal as a new |
Brad review on block#2296: collecting all `p` tags false-positives when buildReplyTags adds a structural reply-author `p` without an @mention. - Extract mentions via tag kind "mention" only (desktop MENTION_REFERENCE_TAG) - Dedup/skip malformed; ignore bare `p` tags - Expand unit matrix for structural-p / online / offline / human / dedup - Document presence as reachability warning, not delivery receipt Refs block#1743 Signed-off-by: Bartok9 <danielrpike9@gmail.com>
d2cb235 to
af2451b
Compare
When a channel message @mentions an agent (bot member) that has no active WebSocket subscription, the relay fan-out silently delivers nothing to it and the mention is lost with no signal to the sender, channel, or any human observer (issue block#1743 — a real 30-minute silent stall between two agents). After a kind:9 (KIND_STREAM_MESSAGE) message is dispatched, this checks any `p`-tagged pubkeys that are bot members against presence. For each mentioned bot with no presence key, it emits a relay-signed system notice (agent_mention_undelivered) into the channel: "<agent> is offline and may not see this mention." Human recipients and online agents are never flagged. - Best-effort, spawned side-effect: never adds latency to dispatch and never fails the triggering event; presence/DB errors are logged and skipped. - Reuses the existing emit_system_message helper (kind:40099). - Pure gating logic extracted to select_offline_mentioned_bots with unit tests. Refs block#1743 Signed-off-by: Bartok9 <danielrpike9@gmail.com>
Brad review on block#2296: collecting all `p` tags false-positives when buildReplyTags adds a structural reply-author `p` without an @mention. - Extract mentions via tag kind "mention" only (desktop MENTION_REFERENCE_TAG) - Dedup/skip malformed; ignore bare `p` tags - Expand unit matrix for structural-p / online / offline / human / dedup - Document presence as reachability warning, not delivery receipt Refs block#1743 Signed-off-by: Bartok9 <danielrpike9@gmail.com>
Contract for block#2296 / block#1743: intentional authored @mentions emit ["mention", pubkey] alongside ["p", pubkey] from SDK build_message, desktop ordinary composer + reply tags + edit path, mobile send, and workflow_sink. Relay offline-agent notices stay gated on mention tags only (never bare structural p). Tests cover parallel tags + structural-p non-trigger. Signed-off-by: Bartok9 <danielrpike9@gmail.com>
af2451b to
abe7a6b
Compare
|
Ready for re-review at Wire contract: intentional @mentions emit parallel |
Refs #1743
When an offline bot is @mentioned, emit a best-effort channel system notice instead of silent loss. Offline gating uses explicit
["mention", pubkey]only (never bare structural reply-authorp). Intentional @mentions now emit parallelp+mentionfrom SDKbuild_message, desktop composer/reply/edit, mobile send, and workflow_sink.Tests: SDK parallel tags; relay extract/select offline matrix.