Skip to content

fix(buzz): reply in-thread instead of flat channel posts - #86232

Open
nanakoice wants to merge 1 commit into
NousResearch:mainfrom
nanakoice:fix/buzz-thread-replies
Open

fix(buzz): reply in-thread instead of flat channel posts#86232
nanakoice wants to merge 1 commit into
NousResearch:mainfrom
nanakoice:fix/buzz-thread-replies

Conversation

@nanakoice

Copy link
Copy Markdown

Summary

Buzz channel threading depends on buzz messages send --reply-to <event-id>. Hermes was dropping the reply anchor for most mid-turn and progress sends, so agents (e.g. Kathy) flooded channels with top-level posts instead of nesting under the triggering message.

Changes

  1. plugins/platforms/buzz/adapter.py — honor metadata.reply_to_message_id (gateway stream/progress path), not only thread_id.
  2. gateway/stream_consumer.py — pass reply_to=self._initial_reply_to_id on interim commentary sends.
  3. gateway/run.py — treat buzz like slack/mattermost for progress thread resolution; set _progress_reply_to to the trigger event id for buzz.

Tests

  • test_send_uses_metadata_reply_to_message_id (buzz adapter)
  • test_buzz_uses_event_message_id_as_progress_thread (progress routing)

Config note (optional hygiene)

For Buzz, official docs still recommend:

display:
  platforms:
    buzz:
      interim_assistant_messages: false
      tool_progress: "off"

This PR fixes threading even if those remain on; suppressing interim traffic further reduces noise.

Motivation

Live deploy: one agent produced ~65 channel posts with only ~8 threaded. After these fixes + display hygiene, new replies nest under the user message.

Buzz has no native thread_id; channel threading is entirely --reply-to on
the triggering event. Interim commentary and progress bubbles only passed
the anchor via metadata.reply_to_message_id (or not at all), so most Kathy
posts landed as new top-level messages and cluttered channels.

- Honor metadata.reply_to_message_id in BuzzAdapter.send
- Pass reply_to on stream commentary sends
- Treat buzz like slack/mattermost for progress thread resolution
- Set _progress_reply_to to the trigger event for buzz
- Add unit tests for adapter metadata and progress routing
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Aug 14, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to #77080 and #80651: all address Buzz progress replies escaping the triggering thread, but this patch combines gateway reply-anchor propagation with adapter metadata handling. Maintainers should choose or consolidate the overlapping approaches.

@Enough1122

Copy link
Copy Markdown
Contributor

AI code review — automated review for reference, author can ignore or act on any point.

fix(buzz): reply in-thread instead of flat channel posts

  1. gateway/stream_consumer.py::_send_commentary now passes reply_to=self._initial_reply_to_id and metadata=self._metadata_for_send(final=False) for all platforms, not just Buzz. If _initial_reply_to_id is ever non-None on a platform that previously posted commentary flat (e.g. a platform where the trigger id is not a valid reply target), this silently changes its threading behavior. Either gate the reply anchor by platform or verify _initial_reply_to_id stays None on the others — the Buzz adapter change alone would have been the narrower fix.
  2. gateway/run.py detects Buzz via str(getattr(source.platform, "value", source.platform) or "").lower() == "buzz" — a magic-string compare duplicated with the adapter logic. A small is_buzz helper or platform-constant set would keep this consistent as the platform list grows.
  3. Adapter precedence reply_to or meta.get("thread_id") or meta.get("reply_to_message_id") is fine for Buzz today, but if a sender ever passes both thread_id and reply_to_message_id, thread_id silently wins even though Buzz has no native threads. Consider preferring reply_to_message_id when thread_id is falsy, or asserting the two never collide.
  4. Test coverage for _resolve_progress_thread_id and the adapter metadata path is good; the _generic_status_phrase Buzz branch has no direct unit test (the resolver tests cover the thread-id derivation, so this is minor).

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

Labels

comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have 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.

3 participants