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 5 times, most recently from d3cfe82 to d516ed0 Compare August 21, 2026 13:17
@Bartok9
Bartok9 force-pushed the bartok9/fix-edit-added-mention-wake branch 6 times, most recently from 6ff57ef to 0c8ec32 Compare August 28, 2026 13:17
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 3c7f288c60d67df78577b237e27c3dfc8831aaa1...cd2217171c7ce874992572a1997e5b8a12fda78f.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review cd2217171c7ce874992572a1997e5b8a12fda78f to authorize a new review.
Any previous review applies only to its recorded range.

@Bartok9
Bartok9 force-pushed the bartok9/fix-edit-added-mention-wake branch 4 times, most recently from 139b02e to 1feddff Compare September 4, 2026 13:16
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>
(cherry picked from commit d516ed0)
Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com>
(cherry picked from commit 0c8ec32)
Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com>
@Bartok9
Bartok9 force-pushed the bartok9/fix-edit-added-mention-wake branch from 1feddff to cd22171 Compare September 7, 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