Skip to content

feat(buzz-acp): isolate sessions by conversation thread#2331

Open
bbamnesia wants to merge 1 commit into
block:mainfrom
bbamnesia:feat/thread-scoped-acp-sessions
Open

feat(buzz-acp): isolate sessions by conversation thread#2331
bbamnesia wants to merge 1 commit into
block:mainfrom
bbamnesia:feat/thread-scoped-acp-sessions

Conversation

@bbamnesia

Copy link
Copy Markdown

Summary

Give each Buzz conversation thread its own ACP session while preserving channel-level behavior for unthreaded messages and DMs.

  • derive a typed conversation scope from the channel and canonical NIP-10 root
  • scope forum roots by their own event ID so forum posts and comments share one session
  • key queueing, in-flight work, cancellation, rotation, and session state by conversation scope
  • allow sibling threads in one channel to execute concurrently without batching or steering each other
  • keep session ownership sticky to one agent while history exists, including when that agent is busy
  • apply desktop model changes across every scoped session in a channel without leaking models to unrelated channels
  • resolve metadata before subscribing to dynamically joined channels so the first event cannot be routed under the wrong scope
  • keep DMs channel-scoped

Behavior

  • replies in one thread reuse one ACP session
  • separate threads in the same channel use separate ACP sessions
  • separate forum posts use separate ACP sessions
  • top-level unthreaded messages retain channel-level continuity
  • !cancel, !rotate, queue deduplication, and retry state target the current conversation scope
  • channel removal still drains all scopes under that channel

Tests

  • cargo test -p buzz-acp605 passed
  • cargo fmt -p buzz-acp -- --check — passed
  • cargo clippy -p buzz-acp --all-targets -- -D warnings — passed
  • cargo check -p sprig — passed
  • workspace Rust fmt/clippy — passed
  • desktop TypeScript/Biome/policy checks — passed
  • desktop Tauri fmt/clippy — passed
  • web checks — passed

just ci reaches the workspace unit suite but current main has an unrelated deterministic buzz-db failure in replica_fence::tests::fence_starts_closed_and_opens_on_advance: the assertion compares a microsecond-truncated stored timestamp with its original nanosecond value. The same isolated test fails without involving any files changed here.

@bbamnesia
bbamnesia requested a review from a team as a code owner July 22, 2026 05:17
Signed-off-by: bbamnesia <68875027+bbamnesia@users.noreply.github.com>
@bbamnesia
bbamnesia force-pushed the feat/thread-scoped-acp-sessions branch from 445556b to 68345bc Compare July 22, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant