From b3af0b68637eadd2cf9ef746b2523f89b60f9707 Mon Sep 17 00:00:00 2001 From: Reinhold <310554180+reinhold-ph@users.noreply.github.com> Date: Sun, 2 Aug 2026 19:59:18 +0000 Subject: [PATCH] fix(buzz): keep progress messages in thread --- gateway/run.py | 2 +- .../gateway/test_buzz_progress_thread_routing.py | 15 +++++++++++++++ website/docs/user-guide/messaging/buzz.md | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 tests/gateway/test_buzz_progress_thread_routing.py diff --git a/gateway/run.py b/gateway/run.py index ad0b31ed34..a1d2246b73 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -1180,7 +1180,7 @@ def _resolve_progress_thread_id( return str(source_thread_id) if source_thread_id else None if source_thread_id: return str(source_thread_id) - if platform_key in {"slack", "mattermost"} and event_message_id: + if platform_key in {"slack", "mattermost", "buzz"} and event_message_id: return str(event_message_id) return None diff --git a/tests/gateway/test_buzz_progress_thread_routing.py b/tests/gateway/test_buzz_progress_thread_routing.py new file mode 100644 index 0000000000..c36dad7bc9 --- /dev/null +++ b/tests/gateway/test_buzz_progress_thread_routing.py @@ -0,0 +1,15 @@ +"""Buzz progress/status thread-routing regressions.""" + +from gateway.run import _resolve_progress_thread_id + + +def test_buzz_progress_without_source_thread_uses_triggering_event(): + """Progress for a Buzz reply must inherit the triggering event anchor.""" + assert ( + _resolve_progress_thread_id( + "buzz", + source_thread_id=None, + event_message_id="buzz-event-123", + ) + == "buzz-event-123" + ) diff --git a/website/docs/user-guide/messaging/buzz.md b/website/docs/user-guide/messaging/buzz.md index 848e21c053..f4a0ac4f75 100644 --- a/website/docs/user-guide/messaging/buzz.md +++ b/website/docs/user-guide/messaging/buzz.md @@ -2,7 +2,7 @@ The Buzz adapter connects Hermes to a [Buzz](https://github.com/block/buzz) community — Block's open-source human+agent collaboration platform built on the Nostr protocol — and relays messages between Buzz channels (or DMs) and the agent. Outbound traffic shells out to the `buzz` CLI binary ("JSON in, JSON out"); inbound uses a native Nostr WebSocket subscription (via the already-bundled `websockets` package) with CLI polling as fallback. **No extra Python packages are required** — just the `buzz` binary. -Buzz renders markdown, so agent replies keep their formatting. Images are delivered as uploads (local files) or links (URLs). Replies can thread onto an existing message via its event id. +Buzz renders markdown, so agent replies keep their formatting. Images are delivered as uploads (local files) or links (URLs). Replies can thread onto an existing message via its event id. When progress or status messages are enabled, they inherit the triggering Buzz event as their reply anchor instead of appearing as unrelated top-level channel posts. Inbound messages arrive over a persistent NIP-42-authenticated Nostr WebSocket subscription by default (near-instant delivery), with automatic fallback to CLI polling when the WebSocket can't be established. Outbound messages always go through the `buzz` CLI. Control it with `transport` / `BUZZ_TRANSPORT`: `auto` (default), `websocket` (require WS, fail otherwise), or `poll`. If your relay membership uses NIP-OA owner attestation, set `BUZZ_AUTH_TAG` to the four-string auth tag JSON.