Skip to content

fix(mobile): p-tag DM recipients so agents receive plain messages - #3604

Open
Chessing234 wants to merge 1 commit into
block:mainfrom
Chessing234:fix/mobile-dm-recipient-p-tags
Open

fix(mobile): p-tag DM recipients so agents receive plain messages#3604
Chessing234 wants to merge 1 commit into
block:mainfrom
Chessing234:fix/mobile-dm-recipient-p-tags

Conversation

@Chessing234

Copy link
Copy Markdown
Contributor

Summary

  • Port desktop's messageMentionPubkeys rule to mobile: DM sends now include p tags for every other participant/member, not only explicit @mentions
  • Without those tags, agent harnesses never receive a turn for plain DM text from the phone (Desktop already worked)

Test plan

  • flutter test test/features/channels/message_mention_pubkeys_test.dart test/features/channels/send_message_provider_test.dart
  • Open a DM with a managed agent on mobile, send hello with no @mention — event carries ["p", <agent>] and the agent replies
  • Same plain message in a stream channel — still no invented recipient p tags
  • Explicit @Agent mentions in a DM still work and stay deduped with the auto recipients

Fixes #3591

Made with Cursor

Desktop already tags every DM participant; mobile only added explicit
@mentions, so agent DMs from the phone never woke a turn.

Signed-off-by: Taksh <takshkothari09@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ScaleLeanChris

Copy link
Copy Markdown

Independent validation from a real Buzz mobile client, hosted Buzz relay, and the Fly Hermes identity:

  • A plain mobile DM, “hey fly,” arrived as kind:9 with only the DM h tag. It had no recipient p tag.
  • An explicit “@fly yo” message added Fly's p tag.
  • Two later plain DM messages again arrived without a p tag.

That reproduces #3591 at the event boundary and confirms the failure is in mobile message construction, not relay delivery. This PR's helper matches the desktop rule: plain DMs address every other participant, explicit mentions remain deduplicated, self is excluded, and stream messages do not invent recipient tags.

I mirrored the exact contributor commit into fork CI because the upstream workflow has not been approved yet. The mobile job passed, including file-size checks, format, analysis, Flutter tests, and an Android debug APK build. The overall fork workflow also ran unrelated desktop jobs; its macOS desktop build failed before compiling Buzz because the mesh-llm checkout was unavailable.

One limitation: our Fly agent uses Hermes's native Buzz adapter, which already works around missing DM p tags by classifying the channel as a DM. Fly therefore still replied after its conversation was latched. This proves the malformed mobile event and the code correction, but it does not independently reproduce the managed ACP wake failure.

After this fix, a plain mobile DM can say “Hello” without also spelling out @fly.

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.

Mobile: DM messages omit recipient p-tags, so agents never receive them

2 participants