Skip to content

Persist agent audiences with native inline mentions#1949

Merged
morgmart merged 8 commits into
mainfrom
morgarita/persistent-agent-audience
Jul 16, 2026
Merged

Persist agent audiences with native inline mentions#1949
morgmart merged 8 commits into
mainfrom
morgarita/persistent-agent-audience

Conversation

@morgmart

@morgmart morgmart commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • adds an opt-in Persistent agent audience desktop setting
  • keeps persistent audiences thread-scoped and inherits eligible root mentions only after the root is authoritative
  • preserves the exact order agents were explicitly authored in, rather than sorting or normalizing their presentation order
  • replaces sent text with retained native mentions immediately, keeps focus at the end, and prevents the mention picker from reopening
  • keeps native mention tags as the sole send-routing source and reconciles manual mention deletion

Behavior

When enabled, agents explicitly included in a successful thread send remain as native inline mentions for the next message in that thread. Switching threads restores that thread's own audience. Timeline sends remain one-shot. Ordinary mention-tag routing is unchanged.

Screenshots

Light

Persistent native agent mentions in light mode

Dark

Persistent native agent mentions in dark mode

Narrow

Persistent native agent mentions at narrow width

Validation

  • focused Playwright persistent-audience suite: 7 passed
    • authored-order root inheritance
    • atomic delayed Enter-send transition
    • picker remains closed and caret remains at document end
    • timeline remains one-shot
    • manual native mention removal persists
    • light, dark, and narrow visual coverage
  • audience unit tests: 12 passed
  • production build and TypeScript typecheck
  • Biome formatting and file-size guard

Notes

The local aggregate pre-push hook ran 2,977 desktop tests; 2 source-contract assertions failed because they still expected the removed timeline audience context and the old thread type guard. Those assertions were updated to the intended thread-only contract and the branch was then pushed after the focused behavioral suite, unit tests, build, typecheck, formatting, and file-size guard passed. The mobile hook lane could not run because dart is unavailable in this worktree environment.

@morgmart
morgmart requested a review from a team as a code owner July 16, 2026 07:35

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The persistent-audience product direction looks useful as an opt-in: identity/channel/thread scoping, native mention tags as the routing source, manual-deletion reconciliation, and the generation/revision guards are good safety properties.

One blocking behavior issue remains: Send without inviting removes non-members only from mentionPubkeys, while completeSend later promotes the unchanged draft.explicitAgentPubkeys. For a non-member agent, the send therefore excludes that agent but still persists it; the next composer hydration re-adds it and presents the same invite choice again. This contradicts the user's explicit decision not to route to/invite that recipient. Please filter persistent-audience promotion to the agent pubkeys that remain effective for this completed send, and cover this path with a regression test.

This head is also currently 5 commits behind main, GitHub reports merge conflicts (including useMentions.ts and playwright.config.ts), and only DCO/Semgrep/zizmor ran. Please rebase, resolve the overlap, and obtain fresh full desktop CI before approval.

npub1n4y9luxx9y27pz5qz93vr9w8auyk7mmpgwf9gpe9tn4zv4kyhzjqtcntu7 and others added 7 commits July 16, 2026 09:02
Co-authored-by: npub1n4y9luxx9y27pz5qz93vr9w8auyk7mmpgwf9gpe9tn4zv4kyhzjqtcntu7 <9d485ff0c62915e08a801162c195c7ef096f6f6143925407255cea2656c4b8a4@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1n4y9luxx9y27pz5qz93vr9w8auyk7mmpgwf9gpe9tn4zv4kyhzjqtcntu7 <9d485ff0c62915e08a801162c195c7ef096f6f6143925407255cea2656c4b8a4@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1n4y9luxx9y27pz5qz93vr9w8auyk7mmpgwf9gpe9tn4zv4kyhzjqtcntu7 <9d485ff0c62915e08a801162c195c7ef096f6f6143925407255cea2656c4b8a4@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1n4y9luxx9y27pz5qz93vr9w8auyk7mmpgwf9gpe9tn4zv4kyhzjqtcntu7 <9d485ff0c62915e08a801162c195c7ef096f6f6143925407255cea2656c4b8a4@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1d6t84ajeg9skp2609l2k6axgcme8x7g7u7luj352r03hcwreg7lqnxcsex <6e967af659416160ab4f2fd56d74c8c6f273791ee7bfc9468a1be37c387947be@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1d6t84ajeg9skp2609l2k6axgcme8x7g7u7luj352r03hcwreg7lqnxcsex <6e967af659416160ab4f2fd56d74c8c6f273791ee7bfc9468a1be37c387947be@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1d6t84ajeg9skp2609l2k6axgcme8x7g7u7luj352r03hcwreg7lqnxcsex <6e967af659416160ab4f2fd56d74c8c6f273791ee7bfc9468a1be37c387947be@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1d6t84ajeg9skp2609l2k6axgcme8x7g7u7luj352r03hcwreg7lqnxcsex <6e967af659416160ab4f2fd56d74c8c6f273791ee7bfc9468a1be37c387947be@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1d6t84ajeg9skp2609l2k6axgcme8x7g7u7luj352r03hcwreg7lqnxcsex <6e967af659416160ab4f2fd56d74c8c6f273791ee7bfc9468a1be37c387947be@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1d6t84ajeg9skp2609l2k6axgcme8x7g7u7luj352r03hcwreg7lqnxcsex <6e967af659416160ab4f2fd56d74c8c6f273791ee7bfc9468a1be37c387947be@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1d6t84ajeg9skp2609l2k6axgcme8x7g7u7luj352r03hcwreg7lqnxcsex <6e967af659416160ab4f2fd56d74c8c6f273791ee7bfc9468a1be37c387947be@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1d6t84ajeg9skp2609l2k6axgcme8x7g7u7luj352r03hcwreg7lqnxcsex <6e967af659416160ab4f2fd56d74c8c6f273791ee7bfc9468a1be37c387947be@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1d6t84ajeg9skp2609l2k6axgcme8x7g7u7luj352r03hcwreg7lqnxcsex <6e967af659416160ab4f2fd56d74c8c6f273791ee7bfc9468a1be37c387947be@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1d6t84ajeg9skp2609l2k6axgcme8x7g7u7luj352r03hcwreg7lqnxcsex <6e967af659416160ab4f2fd56d74c8c6f273791ee7bfc9468a1be37c387947be@sprout-oss.stage.blox.sqprod.co>
@morgmart
morgmart force-pushed the morgarita/persistent-agent-audience branch from 8973f2d to 8a2cd67 Compare July 16, 2026 16:06
@morgmart

Copy link
Copy Markdown
Contributor Author

Addressed the blocking review and rebased onto current main in 8a2cd671:

  • Send without inviting now filters persistent-audience promotion against the recipients that remain effective for the completed send, so an excluded non-member agent is neither routed nor rehydrated afterward.
  • Added regression coverage for excluding removed agents while preserving authored order/deduplication.
  • Resolved the playwright.config.ts conflict by retaining both the new mainline team-mentions suite and this PR’s persistent-audience suite.
  • Resolved the useMentions.ts overlap by retaining mainline team mention insertion and adding the native resolved-mention API used for hydration.

Focused validation passed: 14 audience/send tests, TypeScript typecheck, Biome, and diff checks. GitHub now reports the PR mergeable and fresh full CI is queued.

Co-authored-by: npub1d6t84ajeg9skp2609l2k6axgcme8x7g7u7luj352r03hcwreg7lqnxcsex <6e967af659416160ab4f2fd56d74c8c6f273791ee7bfc9468a1be37c387947be@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1d6t84ajeg9skp2609l2k6axgcme8x7g7u7luj352r03hcwreg7lqnxcsex <6e967af659416160ab4f2fd56d74c8c6f273791ee7bfc9468a1be37c387947be@sprout-oss.stage.blox.sqprod.co>
@morgmart

Copy link
Copy Markdown
Contributor Author

Fixed the Desktop Core failure in 1c1a98e5. The rebase brought useMentions.ts to 1,001 measured lines, one above the 1,000-line guard. I consolidated the duplicated case-insensitive unique-name state update into a small helper, bringing the file to 992 physical lines without adding an override or changing behavior.

Local validation: pnpm check:file-sizes, focused Biome, TypeScript typecheck, diff check, and all 14 focused audience/send tests pass. Fresh CI is starting for the new head.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-reviewed the latest head. The blocking Send without inviting issue is fixed by intersecting explicitly authored agents with the effective mention recipients before promotion, with focused regression coverage. The authored-order behavior remains intact, the branch is mergeable, and full desktop CI is green. I found no remaining behavior blocker.

@morgmart
morgmart merged commit 19dc33b into main Jul 16, 2026
25 checks passed
@morgmart
morgmart deleted the morgarita/persistent-agent-audience branch July 16, 2026 17:25
wpfleger96 added a commit that referenced this pull request Jul 16, 2026
…vider

* origin/main:
  fix(desktop): preserve relaunch through mesh shutdown (#1966)
  Persist agent audiences with native inline mentions (#1949)
  chore(release): release Buzz Desktop version 0.4.8 (#1973)
  fix(desktop): restore default community join option (#1969)
  chore(release): release Buzz Mobile version 0.4.5 (#1965)
wpfleger96 added a commit that referenced this pull request Jul 16, 2026
…esolver

* origin/main:
  Persist agent audiences with native inline mentions (#1949)
  chore(release): release Buzz Desktop version 0.4.8 (#1973)
  fix(desktop): restore default community join option (#1969)
  chore(release): release Buzz Mobile version 0.4.5 (#1965)
tlongwell-block pushed a commit that referenced this pull request Jul 16, 2026
* origin/main:
  Persist agent audiences with native inline mentions (#1949)
  chore(release): release Buzz Desktop version 0.4.8 (#1973)
atishpatel added a commit that referenced this pull request Jul 16, 2026
…adata

* origin/main:
  fix(join-policy): require legal consent on hosted invites (#1987)
  [codex] Prevent actor-tag UI impersonation (#1931)
  chore(release): release Buzz Desktop version 0.4.9 (#1986)
  Restyle onboarding: branded landing screen, yellow/gradient backgrounds, new starter avatars (#1982)
  feat(acp): retry initial relay connection with terminal/transient error classification (#1922)
  feat(mobile): add external release signing mode for central APK Signer pipelines (#1972)
  Guide CLI installation and subscription sign-in (#1980)
  Scope relay runtime state by community (#1658)
  unify channel add + search into one entry point (#1964)
  Apply optional relay join policy across join flows (#1894)
  fix(desktop): preserve relaunch through mesh shutdown (#1966)
  Persist agent audiences with native inline mentions (#1949)
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.

2 participants