Skip to content

fix(desktop+acp): wake agents on edit-added @mentions - #2569

Open
Bartok9 wants to merge 1 commit into
block:mainfrom
Bartok9:bartok9/fix-edit-added-mention-wake
Open

fix(desktop+acp): wake agents on edit-added @mentions#2569
Bartok9 wants to merge 1 commit into
block:mainfrom
Bartok9:bartok9/fix-edit-added-mention-wake

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Closes #2540

Problem

Editing a channel message to add @AgentName did not wake the agent. Fresh sends with the same mention worked.

Root causes

  1. ACP Mentions mode default subscription kinds were only KIND_STREAM_MESSAGE (+ approval/reminder). kind:40003 edits never matched the filter, so even a correct p tag on the edit event could not start a turn.
  2. build_message_edit only attached p tags for newly added mention pubkeys (composer already diffs via diffAddedMentionPubkeys). Send attaches both p and explicit mention reference tags (MENTION_REFERENCE_TAG). Edit lacked the mention refs (parity / offline-notice / resolve paths).

Fix

  • Include KIND_STREAM_MESSAGE_EDIT in default Mentions kinds (crates/buzz-acp/src/lib.rs). require_mention still requires a matching p tag on the edit event (composer only adds p for newly added mentions — typo-fix edits stay quiet).
  • build_message_edit emits paired mention ref tags for those same pubkeys.
  • Unit test: edit with added mention emits both p and mention.

Test

cd desktop/src-tauri && cargo test --lib events::tests::edit_

All 3 edit_mention tests passed.

Signed-off-by: Bartok9 <danielrpike9@gmail.com>

@Bartok9
Bartok9 requested a review from a team as a code owner July 23, 2026 17:24
@Bartok9
Bartok9 force-pushed the bartok9/fix-edit-added-mention-wake branch 3 times, most recently from 10f7b18 to e95a5c8 Compare July 25, 2026 18:20
Issue block#2540: editing a kind-9 message to add @agent never fired a turn
because (1) Mentions-mode ACP only subscribed to kind 9 (not 40003 edits)
and (2) build_message_edit emitted `p` tags but not explicit `mention`
reference tags that send already attaches.

- Default Mentions subscription kinds include KIND_STREAM_MESSAGE_EDIT
- build_message_edit emits matching `mention` refs with newly added `p`s
- Unit test asserts mention ref on edit-added audience

Closes block#2540

Signed-off-by: Bartok9 <danielrpike9@gmail.com>
@Bartok9
Bartok9 force-pushed the bartok9/fix-edit-added-mention-wake branch from e95a5c8 to 31a880e Compare July 28, 2026 13: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.

[Bug] Editing a message to add an @mention does not trigger the mentioned agent

1 participant