Skip to content

fix(buzz): treat NIP-10 replies to own messages as mentions - #75953

Closed
arimu1 wants to merge 1 commit into
NousResearch:mainfrom
arimu1:fix/75826-buzz-nip10-thread-reply-mention
Closed

arimu1 wants to merge 1 commit into
NousResearch:mainfrom
arimu1:fix/75826-buzz-nip10-thread-reply-mention

Conversation

@arimu1

@arimu1 arimu1 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

With require_mention enabled (the default), the Buzz adapter only treated a channel message as addressed when the visible text mentioned the agent. NIP-10 e tags were never parsed, so a thread reply whose direct parent is the agent's own message was silently dropped — even /approve session typed via Buzz Desktop's natural reply affordance.

This matches Signal/WhatsApp: a reply to the bot's own message counts as addressed. p-tag DM classification (#68871) is deliberately unchanged.

Related Issue

Fixes #75826

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • plugins/platforms/buzz/adapter.py:
    • Bound per-channel event_meta cache: event_id → (author_pubkey, content[:500])
    • Feed cache from seed (post-restart), poll/WS _handle_event (including self-echo), and send/send_image return event_id
    • Resolve direct parent NIP-10-style: reply-marked e tag, else root, else last positional e
    • Mention gate: also dispatch when that parent is one of our messages
    • Populate reply_to_message_id / reply_to_text / reply_to_author_id / reply_to_is_own_message on MessageEvent (including the visible-mention path)
  • tests/gateway/test_buzz_adapter.py: 7 regression tests for buzz: require_mention drops NIP-10 thread replies to the agent's own messages — /approve responses never dispatch #75826 (+ parent-marker unit)

How to Test

  1. scripts/run_tests.sh tests/gateway/test_buzz_adapter.py -q → 31 passed
  2. Scenarios covered: unmentioned thread reply to own message; /approve session / /approve always; reply to other user / unknown parent stay gated; seed + send-recorded parents match; mention path still fills reply context

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS (aarch64)

Focused suite run via scripts/run_tests.sh (repo canonical runner). Full suite not run; checkbox left unchecked intentionally.

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

No new config keys. Behavior documented in adapter comments.

Overlap note

Open #75049 (thread_require_mention feature) still defaults to strict mention-in-thread and is a configurable policy feature, not this bugfix. No open PR linked #75826 at open time.

Screenshots / Logs

N/A — unit coverage above.

require_mention gated only on visible text, so Desktop thread replies
(e.g. /approve session) to the agent's own prompts were dropped with no
log. Cache event_id→(author, snippet) from seed/poll/WS/send, resolve
the direct e-tag parent, and dispatch when that parent is ours; also
populate reply_to_* on MessageEvent for gateway context injection.

Fixes NousResearch#75826
@teknium1

teknium1 commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the focused Buzz fix. The premise remains present on current main: plugins/platforms/buzz/adapter.py:1012 drops all unmentioned non-DM messages, and plugins/platforms/buzz/adapter.py:1211-1217 does not construct the reply-context fields that gateway/run.py:15297-15311 consumes. The proposed parent lookup and metadata cache act in _handle_event, which is shared by polling and WebSocket delivery (plugins/platforms/buzz/adapter.py:860). No blocking issues were identified in static review.

Automated hermes-sweeper review.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Aug 1, 2026
@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Aug 1, 2026
@GottZ

GottZ commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Summary

One PR addresses #75826. #75953 fixes the reported mention-gate failure by resolving NIP-10 reply parents, treating replies to the agent’s own messages as addressed, and propagating reply context into MessageEvent.

Related pull requests

  • fix(buzz): treat NIP-10 replies to own messages as mentions #75953 best fix — (+394/-14) — keep open with a salvage path: The diff adds a bounded per-channel metadata cache populated from seed history, inbound events, and sent-message IDs, then uses the direct NIP-10 parent to admit replies to the agent’s own messages while keeping replies to other or unknown parents gated. Consistent with the automated keep-open verdict on fix(buzz): treat NIP-10 replies to own messages as mentions #75953, preserve the parent resolver, reply-aware mention gate, reply-context propagation, and focused regression tests covering approval replies, restart history, send-without-echo, and negative cases.

Suggested consolidation

Keep #75953 open with a salvage path: retain its NIP-10 parent resolution, bounded metadata cache across seed/inbound/send paths, reply-aware mention gating, reply-context propagation, and focused regression coverage. It is the only PR in this complex, so there are no competing PRs to close as duplicates.

Complex graph

flowchart LR
    classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
    classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
    classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
    classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
    classDef best stroke-width:3px,stroke:#b45309
    classDef target stroke-width:3px,stroke:#4338ca
    I75826(["issue #75826 (open)"])
    P75953["PR #75953 (open)"]
    P75953 -->|best fix| I75826
    class I75826 open
    class P75953 open
    class P75953 best
    class P75953 target
    click I75826 "https://github.com/NousResearch/hermes-agent/issues/75826"
    click P75953 "https://github.com/NousResearch/hermes-agent/pull/75953"
Loading

Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label).

Cross-PR triage: Reviewed 1 pull request and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 23 kB of PR diffs, 7 kB of issue/PR text, 2 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

@teknium1

Copy link
Copy Markdown
Collaborator

Merged via #99431 — your NIP-10 reply-parent resolution was cherry-picked with authorship preserved. This was the fix for the /approve deadlock (#75826): thread replies to the agent's own messages now dispatch under require_mention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buzz: require_mention drops NIP-10 thread replies to the agent's own messages — /approve responses never dispatch

4 participants