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 5 times, most recently from 31a880e to e423b11 Compare July 29, 2026 13:17
@Bartok9
Bartok9 force-pushed the bartok9/fix-edit-added-mention-wake branch 7 times, most recently from 61c6525 to 2e3b821 Compare August 5, 2026 13:19
@Bartok9
Bartok9 force-pushed the bartok9/fix-edit-added-mention-wake branch 2 times, most recently from e5c1068 to 941250c Compare August 10, 2026 13:21
@Bartok9 Bartok9 closed this Aug 11, 2026
@Bartok9
Bartok9 force-pushed the bartok9/fix-edit-added-mention-wake branch from 941250c to cf03bd7 Compare August 11, 2026 18:53
@Bartok9 Bartok9 reopened this Aug 11, 2026
@Bartok9
Bartok9 force-pushed the bartok9/fix-edit-added-mention-wake branch 4 times, most recently from a8cdd3d to d3cfe82 Compare August 19, 2026 16:55
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>
(cherry picked from commit 4935102)
Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com>
(cherry picked from commit d3cfe82)
Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com>
@Bartok9
Bartok9 force-pushed the bartok9/fix-edit-added-mention-wake branch from d3cfe82 to d516ed0 Compare August 21, 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