Skip to content

feat(agents): add contextual agent conversations - #4688

Open
BrianInAz wants to merge 9 commits into
block:mainfrom
BrianInAz:codex/upstream-contextual-agent-conversations
Open

feat(agents): add contextual agent conversations#4688
BrianInAz wants to merge 9 commits into
block:mainfrom
BrianInAz:codex/upstream-contextual-agent-conversations

Conversation

@BrianInAz

@BrianInAz BrianInAz commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • define one contextual-conversation policy and shared fixture used by Desktop, Mobile, and ACP
  • add Desktop and Mobile controls for unaddressed channel messages and persistent addressed-agent audiences
  • include resolved agent recipients on outgoing messages while preserving explicit mentions and DM audiences
  • keep single-agent ACP replies flat and place multi-agent replies in a shared thread

Related issue

None found. #1743 is adjacent but concerns offline mention delivery, which this PR does not change.

Behavior

  • channel sends resolve contextual agent recipients from the selected unaddressed-message mode, explicit mentions, and the persisted audience
  • successful explicit-agent sends can promote the addressed agents for subsequent conversation turns
  • failed sends do not mutate the persistent audience
  • thread, channel, owner, and DM boundaries remain isolated
  • Desktop preserves explicit agent mentions when merging DM recipients

Protocol compatibility

This uses existing Nostr p and reply tags. It does not add event kinds, relay behavior, HTTP endpoints, server-side fan-out, or release workflow changes.

Testing

  • just ci
  • cargo test -p buzz-acp --lib (676 passed)
  • focused Flutter contextual-agent/send tests (19 passed)
  • just mobile-check
  • pnpm --dir desktop test (4,154 passed)
  • Desktop E2E build plus unaddressed-channel-agent-mode.spec.ts smoke test (1 passed)

Rebased and validated on block/buzz@feccf4eabc23fdba94ce3537a194357ed17b197c. All commits carry DCO sign-off. Fork-only private-CA and release lifecycle changes are intentionally excluded.

Shared test-only fixture for audience selection and reply placement, with
pure Desktop/Rust/Dart resolvers that implement the contract and device-local
unaddressed-channel mode storage key. Composer/ACP/UI wiring remains later.

Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
(cherry picked from commit 78458eb)
Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
Add device-local Unaddressed channel messages setting, merge pure policy
into mention send p-tags, and show a composer audience hint. Explicit
mentions still win; mentions-only disables implicit channel-agent notify.

Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
(cherry picked from commit 88a1161)
Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
Share pubkey normalization, keep composer hint on the same resolver as
send, skip no-op mode writes, and expand coverage for persistent
audience, load errors, direct DMs, and manual removal.

Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
(cherry picked from commit d6978d4)
Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
…eads

Wire the shared contextual-conversation ReplyPlacement policy into ACP
prompt reply anchors. Human-facing channel turns with one addressed agent
stay top-level; two or more open a shared thread at the human event; thread
follow-ups keep anchoring to the root; agent-only traffic remains unconstrained.

Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
(cherry picked from commit 300b7b5)
Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
Add Flutter settings for Unaddressed channel messages, SharedPreferences
storage matching Desktop, and merge pure policy audience into channel
sends. Also cargo-fmt ACP after reply-placement work.

Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
(cherry picked from commit bad5392)
Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
Register a Playwright smoke that opens Settings › Agents, toggles
Notify all / Mentions only, and checks device-local persistence.

Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
(cherry picked from commit 3796ea4)
Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
Biome format on policy unit tests; provide required SendMessage
constructor args in Flutter unit tests after audience wiring.

Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
(cherry picked from commit af9d56e)
Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
Move contextual-audience logic out of MessageComposer so the file no
longer grows past the line budget; format mobile SendMessage unit tests.

Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
(cherry picked from commit 445100d)
Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
Authored @agent mentions must survive the direct-conversation audience
resolver so existing DMs can still expand to include a newly mentioned
relay agent. Extracted composer audience helpers stay under the file-size
ratchet.

Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
(cherry picked from commit ff08ba0)
Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
@BrianInAz
BrianInAz requested a review from a team as a code owner August 4, 2026 08:33
@BrianInAz

Copy link
Copy Markdown
Author

Contextual agent conversation settings

Desktop exposes the unaddressed-channel delivery mode and persistent addressed-agent audience controls together in Agents settings.

01-agent-conversation-settings

BrianInAz added a commit to BrianInAz/buzz that referenced this pull request Aug 4, 2026
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