Skip to content

feat(buzz): auto-join channels and per-thread sessions - #79058

Closed
0809android wants to merge 2 commits into
NousResearch:mainfrom
0809android:feat/buzz-auto-join-thread-sessions
Closed

0809android wants to merge 2 commits into
NousResearch:mainfrom
0809android:feat/buzz-auto-join-thread-sessions

Conversation

@0809android

@0809android 0809android commented Aug 5, 2026

Copy link
Copy Markdown

Summary

Add opt-in Buzz behavior:

  • Auto-join new open group channels without restarting the gateway
  • Isolate Hermes sessions by thread root
  • Anchor replies to the visible thread root
  • Avoid replaying channel history when adopting channels

Both options default to off.

Validation

  • Targeted Buzz tests passed
  • Live-verified against a self-hosted Buzz relay: new channels were adopted without restart and separate threads kept separate sessions

Related

@spfcraze

spfcraze commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Auto-joined group channels are adopted with last_ts: 0 and an empty seen set because all three production call sites of _discover_group_channels pass seed=False, so the first poll of a pre-existing channel fetches its newest 50 events without a --since bound and runs them through the dispatch gates.

Problems:

  • plugins/platforms/buzz/adapter.py: the three production call sites (membership handler, WS recv-timeout sweep, poll loop) all pass seed=False; seed=True appears only in the test additions. The seed=False branch adds the channel with last_ts: 0 and seen: OrderedDict() and never calls _seed_channel.
  • _poll_channel only adds --since when state["last_ts"] is truthy, so the first poll of an adopted channel with history fetches the newest _FETCH_LIMIT (50) events with no bound; events passing the gates dispatch, and in a group with require_mention: false that includes every recent pre-join message. The startup path exists precisely to avoid this: "Seed high-water marks from the newest events so a (re)start never replays channel history into the agent" (adapter.py:535-536).

Suggested changes:

  • Call _seed_channel(ch_id, chat_type="group") when adopting an auto-joined channel (or set last_ts to the current time) so pre-existing history is not dispatched on the first poll.

Checked against 04036c2 — the PR head when this was written — and aec3318, main at the same moment.

@alt-glitch alt-glitch added type/feature New feature or request 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 sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Aug 5, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Related: #74823 covers live joined-channel adoption and #74516 covers Buzz thread-scoped sessions. This PR combines both surfaces; maintainers should compare their policy and implementation choices.

Copy link
Copy Markdown
Author

Updated the branch against current main and addressed the history-replay finding.

The new head now:

  • adopts newly discovered channels with a bounded lookback instead of last_ts: 0
  • persists adopted channels so restart seeding suppresses replay
  • resolves markerless nested replies recursively and retries successful-but-empty parent reads
  • keeps DMs on one continuing session
  • anchors text and image replies to the visible thread root
  • runs discovery on a real deadline even while WebSocket traffic is busy
  • chunks channel filters into bounded WebSocket subscriptions (10 filters per REQ) so large channel sets do not hit relay subscription/rate limits

Profile-to-channel lifecycle reconciliation is intentionally excluded from this PR and is tracked separately in draft PR #80457.

@alt-glitch alt-glitch added the needs-decision Awaiting maintainer decision before any implementation label Aug 9, 2026
@0809android

Copy link
Copy Markdown
Author

Closing this competing implementation after re-checking the existing Buzz work. #74823 already covers dynamic joined-channel discovery, while #74516 and #74084 cover thread-scoped sessions. I should have contributed to those threads instead of opening a combined alternative. Sorry for adding duplicate review surface.

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 needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants