Skip to content

fix(acp): wake agents for mentions added by edits - #4741

Open
loganj wants to merge 1 commit into
mainfrom
fix/edit-message-agent-mentions
Open

fix(acp): wake agents for mentions added by edits#4741
loganj wants to merge 1 commit into
mainfrom
fix/edit-message-agent-mentions

Conversation

@loganj

@loganj loganj commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

🤖

Summary

  • Fixes edited messages failing to wake an agent when the edit adds that agent as a new mention.
  • Adds stream-message edits (kind:40003) to the ACP harness's default actionable-mention subscriptions for startup, dynamically discovered channels, and setup/not-ready mode.
  • Keeps the existing p-tag requirement and preserves explicit --kinds and config-rule overrides, so ordinary edits and unchanged mentions do not re-wake agents.
  • Documents the updated defaults.

Related issue

None found. Source report: Buzz task thread

Testing

  • cargo fmt --all -- --check
  • cargo test -p buzz-acp — 670 unit tests and 9 integration tests passed
  • cargo check -p buzz-acp
  • git diff --check
  • Pre-push: branch-skew, Rust tests, Desktop checks/tests, and Desktop Tauri clippy/tests passed

@loganj
loganj force-pushed the fix/edit-message-agent-mentions branch from 56e2c58 to a47e638 Compare August 4, 2026 16:16
Include kind:40003 in the default mention subscriptions across normal, dynamic-channel, and setup listeners. Preserve explicit kind overrides and document the actionable default.

Signed-off-by: npub1em3jmyn4vu57urqf03txrwreccvejvwdy5c4er8nnrwt7rc4tncscs3ssu <cee32d92756729ee0c097c5661b879c6199931cd25315c8cf398dcbf0f155cf1@buzz.block.builderlab.xyz>
@loganj
loganj force-pushed the fix/edit-message-agent-mentions branch from a47e638 to ac89510 Compare August 4, 2026 16:48
@loganj
loganj marked this pull request as ready for review August 4, 2026 18:15
@loganj
loganj requested a review from a team as a code owner August 4, 2026 18:15

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac89510841

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

pub(crate) fn default_mention_kinds() -> Vec<u32> {
vec![
KIND_STREAM_MESSAGE,
KIND_STREAM_MESSAGE_EDIT,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resolve edit mentions to the original message before prompting

When a kind 40003 event wakes the harness, its bare e tag identifies the edited message, but parse_thread_tags only recognizes marker-based NIP-10 tags. The edit is therefore treated as a top-level message, and the prompt tells the agent to reply with --reply-to <edit-event-id>; the CLI then roots that reply at the auxiliary edit rather than the visible original message. Such replies do not appear in the original thread, and the setup listener has the same problem when publishing its nudge. Resolve the edit target and use the original message/thread as the context and reply anchor before forwarding these events.

Useful? React with 👍 / 👎.

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