Skip to content

feat(dms): name blocking agents clearly, leave agents out of DM names, let owners remove their agent - #3744

Merged
morgmart merged 8 commits into
mainfrom
morganm/dm-policy-names
Nov 24, 2026
Merged

morgmart merged 8 commits into
mainfrom
morganm/dm-policy-names

Conversation

@morgmart

@morgmart morgmart commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Three follow-ups to growable DMs (#2670):

  1. When an agent's add policy blocks a DM, desktop shows a generic "Try again" error. The person can't tell which agent blocked it or whose owner to ask.
  2. DM names list every member, agents included, so a DM with one person and their agent reads like a group, and "+N" mixes agents with people.
  3. Once you add your own agent to a DM, you can't take it out. The relay allows it, but desktop hid Remove in every DM.

Change

Name the blocking agent. The relay now names the agent in that refusal (block/buzz#9601). Desktop passes the refusal through and shows the agent's name:

  • Only its owner can add it, owner known: "Only Morgan can add Scout to a DM."
  • Only its owner can add it, owner unknown: "Only the owner of Scout can add it to a DM."
  • No one can add it: "Scout can't be added to a DM."
  • When adding to an existing DM, all start with "Couldn't add them."
  • If the name can't be read, it says "this agent".

The agent and owner use the app's identity labels, so two agents with the same name read differently ("Morgan's Scout"), and an agent that shares a person's name reads as "Scout (agent)". The owner is named only when the agent's profile carries a verified owner signature.

This is handled once where the app opens and adds DMs, so every DM entry point names the agent with no screen changes. Against a relay without #9601, the error is the same as before.

Leave agents out of DM names. A DM's name lists its people and never its agents, unless no other person is in it (just you and agents), when it names the agents. "+N" counts people only. Member counts and member lists still include agents. One shared rule feeds the sidebar, Activity, drafts, search and link previews. Agent means the profile's existing agent flag; a profile that hasn't loaded yet counts as a person until it says otherwise.

Let owners remove their own agent from a DM. In a DM's member list, an agent you verifiably own now has "Remove from DM", with a "Remove agent from DM" confirmation. People never get Remove in a DM, and admin and role actions stay out of DMs, matching the relay rule.

Mobile match: block/buzz#9875 (names and DM labels), block/buzz#9921 (blocked agent wording and Remove from DM)

Screenshots

Name the blocking agent

New message, refused by an agent's owner-only setting with no verified owner (temporary headless render with test data, not committed):

Light Dark
Wide light wide dark wide
Narrow light narrow dark narrow

DM names without agents

Sidebar with three DMs: Alice alone, Alice with two agents (named "Alice Fixture", count still 3), and only the two agents (named by them). Temporary headless render with test data, not committed.

Light Dark
Wide light wide dark wide
Narrow light narrow dark narrow

Remove your agent from a DM

DM member list with your verified agent Scout: the actions menu, then the confirmation. Temporary headless render with test data, not committed.

Light Dark
Menu, wide menu light wide menu dark wide
Menu, narrow menu light narrow menu dark narrow
Confirm, wide confirm light wide confirm dark wide
Confirm, narrow confirm light narrow confirm dark narrow

Tests

  • Blocking agent: unit tests for reading the refusal, ignoring lookalikes and wording the message; DM open and add name the agent and fall back to "this agent"; the browser host and the native Rust mapping pass the refusal through.
  • Agent naming: verified owner named; two same-named agents; an agent sharing a person's name; owner unknown.
  • DM names: people and agents, only agents, more than three people and agents, and a profile that hasn't loaded yet, in the shared label and the sidebar. Search results and link previews now also check that a DM's name leaves agents out.
  • Remove from DM: a DM member or owner can remove their own verified agent; no one can remove another person's agent or a person; the menu shows "Remove from DM" and sends the removal only for your own agent.

The lost-reply recovery was taken out after review. It comes back as a relay change that answers a replayed signed command with its saved result, so the app can resend the same event instead of guessing from rosters.

🤖 Generated with Claude Code

morgmart and others added 4 commits November 17, 2026 11:26
When an agent's add policy refuses a DM open or add, the relay now
names the agent (block/buzz#9601). The native and browser hosts pass
that refusal on as `policy:<policy> (agent <pubkey>)` instead of the
generic retry message, and opening or adding a DM turns it into
"Only <Name>'s owner can add it to a DM." or "<Name> can't be added to
a DM." Every DM opener and the members dialog already show the
error's own words, so they all name the agent. Without a readable
name, it says "this agent".

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A DM's name lists its people and never its agents, unless no other
person is in it. "+N" counts people only, and member counts and lists
still include agents. One shared rule feeds the sidebar, Activity,
drafts, search, and link previews.

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The relay can commit an add and its answer be lost. Before reporting
the add failed, read the signed roster: if this DM now holds them, or a
DM the viewer was not in holds its people and them, the add landed
there. Only when the roster shows no such change does it fail, so
adding again never resends an add that already landed.

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@morgmart morgmart changed the title feat(dms): name the agent whose add policy refuses a DM feat(dms): name blocking agents, leave agents out of DM names, recover lost adds Nov 23, 2026
@morgmart
morgmart marked this pull request as ready for review November 23, 2026 05:52
@morgmart
morgmart requested a review from a team as a code owner November 23, 2026 05:52

@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.

🤖 Star Lord

Changes needed at bd27509. Recovery can open the wrong DM or invite another membership write after the first add committed. Reviewed from source.

Comment thread src/features/relay/direct-messages.ts Resolved
Comment thread src/features/relay/direct-messages.ts Resolved
Guessing from rosters can't be exact: a roster can trail the commit, a superset can match, and refusals were reconciled too. The lost-reply fix returns as a relay change that answers a replayed command with its saved result.

This reverts commit bd27509.

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@morgmart morgmart changed the title feat(dms): name blocking agents, leave agents out of DM names, recover lost adds feat(dms): name blocking agents, leave agents out of DM names Nov 23, 2026
@morgmart
morgmart requested a review from wesbillman November 23, 2026 06:25
@morgmart

Copy link
Copy Markdown
Contributor Author

🤖 Carl, Morgan's agent: @wesbillman the lost-reply recovery is reverted (696572a), so this PR is back to the naming rule and the blocking-agent error. Could you re-review?

morgmart added a commit to block/buzz that referenced this pull request Nov 23, 2026
## Problem

Two follow-ups to growable DMs (#9153), matching desktop
block/buzz-app#3744:

1. When an agent's add policy blocks a DM, mobile shows a generic error.
The person can't tell which agent blocked it or whose owner to ask.
2. DM names list every member, agents included, so a DM with one person
and their agent reads like a group, and "+N more" mixes agents with
people.

## Change

**Name the blocking agent.** The relay names the agent in that refusal
(#9601). Mobile shows the agent's name: "Only Scout's owner can add it
to a DM." or "Scout can't be added to a DM.", starting with "Couldn't
add them." when adding to an existing DM, and "this agent" when the name
can't be read. Against a relay without #9601, the error is the same as
before.

**Leave agents out of DM names.** A DM's name lists its people and never
its agents, unless no other person is in it (just you and agents), when
it names the agents. "+N more" counts people only. Member counts and
member lists still include agents. The shared DM label feeds the list,
headers, details and Activity. Agent means the profile's existing agent
flag; a profile that hasn't loaded yet counts as a person until it says
otherwise.

## Screenshots

Temporary headless renders with test data, not committed.

### Name the blocking agent

Add people, refused by an agent's owner-only setting:

| | Light | Dark |
|---|---|---|
| Narrow | ![light
narrow](https://github.com/user-attachments/assets/61bfbfe2-5882-456e-8bff-b42f7389aa06)
| ![dark
narrow](https://github.com/user-attachments/assets/d7ac0dca-9081-4cde-a403-cde492d2cf4f)
|
| Wide | ![light
wide](https://github.com/user-attachments/assets/cc9f5a0f-0f3a-4d80-8fc6-0937a2246462)
| ![dark
wide](https://github.com/user-attachments/assets/87b48014-9740-4e17-ad83-f5bac272dda8)
|

### DM names without agents

Ana alone, Ana with two agents (named "Ana", count still 3), and only
the two agents (named by them):

| | Light | Dark |
|---|---|---|
| Narrow | ![light
narrow](https://github.com/user-attachments/assets/b413dbc1-a2bc-4410-8be9-b1a219374349)
| ![dark
narrow](https://github.com/user-attachments/assets/75c9cbc3-432f-45c7-83a4-624f80752b97)
|
| Wide | ![light
wide](https://github.com/user-attachments/assets/ae57c305-f4e4-4e26-8ba0-ecbcd128137e)
| ![dark
wide](https://github.com/user-attachments/assets/a75efc90-6b20-4409-bdd5-682de1f0301f)
|

## Tests

- Blocking agent: an open and an add name the agent, fall back to "this
agent", and leave other refusals as they were.
- DM names: people and agents, only agents, more than three people and
agents, and a profile that hasn't loaded yet.

The lost-reply recovery was taken out after review. It comes back as a
relay change that answers a replayed signed command with its saved
result, so the app can resend the same event instead of guessing from
rosters.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

@wpfleger96 wpfleger96 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 Reviewed from source at 696572a2. The refusal readers in Rust and TypeScript match the relay's policy:<policy> … (agent <hex>) wording from block/buzz#9601 (buzz-db store/dm.rs), and the no-owner case can't reach them because that query only returns agents with an owner. dmNamedParticipants gets full profiles at every caller, and the sidebar's cached labels refresh when profiles change, so an agent whose profile loads late drops out of the name. The earlier lost-reply findings no longer apply now that the recovery is removed. No blocking concerns.

morgmart and others added 3 commits November 23, 2026 14:42
An agent's add-policy refusal named the agent by its raw profile name, so two agents called Scout read the same. Name it with the identity label the app uses elsewhere ("Morgan’s Scout", "Alice (agent)"), and name its verified owner as the one to ask: "Only Morgan can add Scout to a DM." Without a verified owner, it reads "Only the owner of Scout can add it to a DM."

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The relay lets an owner remove their own agent from a DM, but members' actions still offered no removal in a DM, left from when a DM could not change. Offer Remove from DM for an agent the viewer owns. No one may remove a person or another's agent from a DM, as the relay decides.

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@morgmart morgmart changed the title feat(dms): name blocking agents, leave agents out of DM names feat(dms): name blocking agents clearly, leave agents out of DM names, let owners remove their agent Nov 23, 2026
@morgmart
morgmart requested a review from wpfleger96 November 23, 2026 23:03
@morgmart

Copy link
Copy Markdown
Contributor Author

🤖 Carl, Morgan's agent: pushed two follow-ups (head 5e3e688), so @wpfleger96 your approval needs a fresh look, and @wesbillman too if you have time:

  • A blocked agent is now named with the app's identity labels, so same-named agents differ, and the verified owner is named when known.
  • An owner can remove their own agent from a DM ("Remove from DM"); people and other people's agents still can't be removed there.

The description and screenshots are updated.

morgmart added a commit to block/buzz that referenced this pull request Nov 24, 2026
…nt from a DM (#9921)

## Problem

Two follow-ups to growable DMs on mobile, matching desktop
block/buzz-app#3744:

1. When an agent's add policy blocks a DM, the message names the agent
by display name only, so two agents called "Scout" read the same, and it
never says whose owner to ask.
2. Once you add your own agent to a DM, you can't take it out. The relay
allows it, but mobile hid Remove in every DM.

## Change

**Name the blocked agent clearly.** The refusal now uses the app's
identity labels for the agent and its owner:

- Only its owner can add it, owner known: "Only Morgan can add Scout to
a DM."
- Only its owner can add it, owner unknown: "Only the owner of Scout can
add it to a DM."
- No one can add it: "Scout can't be added to a DM."
- When adding to an existing DM, all start with "Couldn't add them."
- If the name can't be read, it says "this agent".

Labels are compared against the people in the DM, so two same-named
agents read as "Morgan's Scout", and an agent that shares a person's
name reads as "Scout (agent)". The owner is named only when it is
verified from the agent's signed profile.

**Let owners remove their own agent from a DM.** On a DM member's
profile, an agent you verifiably own now has "Remove from DM", confirmed
with "Remove from DM?". People never get Remove in a DM, and admin and
role actions stay out of DMs, matching the relay rule.

## Screenshots

Temporary widget renders with test data, not committed. The refusal
render passes the shared wording a known owner and a disambiguated agent
label; label resolution itself is covered by the tests below.

### Blocked agent

| | Light | Dark |
|---|---|---|
| Narrow | ![refusal light
narrow](https://github.com/user-attachments/assets/fe6b08c4-01d0-43c5-b6ba-5416ac07cecb)
| ![refusal dark
narrow](https://github.com/user-attachments/assets/ef30bd2a-4a3b-45dd-829c-25f956f023ed)
|
| Wide | ![refusal light
wide](https://github.com/user-attachments/assets/9a193a12-5a6c-491d-af30-a95afb649b5e)
| ![refusal dark
wide](https://github.com/user-attachments/assets/eeab3f52-1556-4248-adc3-0e55b6511720)
|

### Remove from DM

| | Light | Dark |
|---|---|---|
| Row, narrow | ![row light
narrow](https://github.com/user-attachments/assets/a4ec6a75-f749-4cb8-be0d-13c82427a292)
| ![row dark
narrow](https://github.com/user-attachments/assets/9ac8ee1d-152e-47ec-813b-7a61ccdbe15d)
|
| Row, wide | ![row light
wide](https://github.com/user-attachments/assets/bf465fe0-8b3c-462b-82ce-2b1527056656)
| ![row dark
wide](https://github.com/user-attachments/assets/bc991265-3e49-4241-a3aa-c499aac4f3ee)
|
| Confirm, narrow | ![confirm light
narrow](https://github.com/user-attachments/assets/8088a4da-a665-4591-95ae-1ecc984f77b1)
| ![confirm dark
narrow](https://github.com/user-attachments/assets/11a52247-dcf0-4105-be4d-9f3ba3f14838)
|
| Confirm, wide | ![confirm light
wide](https://github.com/user-attachments/assets/281ba908-d187-4b8e-889e-baa4c81bd44d)
| ![confirm dark
wide](https://github.com/user-attachments/assets/537b2b49-78f6-4074-9ba8-fbce2f55b9a8)
|

## Tests

- Wording for every case, plus opening and adding with a verified owner,
two same-named agents, an agent sharing a person's name, and owner
unknown.
- Remove from DM: the owner removes their agent after confirming; no
Remove for another person's agent, an unowned agent, or a person.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Tom Brow <tomb@block.xyz>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost>

@wpfleger96 wpfleger96 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 Re-reviewed from source at 5e3e6881. The refusal now names the agent through the app's identity-name resolver, so same-named agents and a person with the same name come out distinct. For an owner-only refusal it names the owner from the agent's signed owner attestation, and falls back to "the owner of …" when there's no attestation. Remove from DM is offered only for an agent the viewer owns, which matches the relay's DM rule in side_effects.rs: anyone may leave, and an owner may remove their own agent. The new search and link-preview tests cover the DM-name surfaces that had no test before. No blocking concerns.

@morgmart
morgmart merged commit b5b90e4 into main Nov 24, 2026
139 of 141 checks passed
@morgmart
morgmart deleted the morganm/dm-policy-names branch November 24, 2026 16:58
wpfleger96 added a commit that referenced this pull request Nov 24, 2026
…rotect-own-channel-floor

* origin/main: (25 commits)
  feat(navigation): go back and forward with ⌘←/⌘→ from an empty composer on macOS (#4304)
  fix(messages): keep details dialog scrollbar inside its rounded frame (#4340)
  fix(communities): mark an inactive community read from its menu (#4338)
  fix(messages): stack details over an inline thread as panels do (#4313)
  feat(settings): edit base instructions with the shared editor (#4285)
  chore(deps): upgrade tailwindcss and @tailwindcss/postcss to 4.3.5 (#4150)
  docs(perf): refresh native thread-scrolling measurements for 2026-11-24 (#4337)
  feat(dms): name blocking agents clearly, leave agents out of DM names, let owners remove their agent (#3744)
  Finder: search your messages with ⌘P (#4167)
  fix(messages): draw no placeholders while a thread opens (#4312)
  fix(shortcuts): number only communities in the switcher (#4287)
  fix(messages): measure upward scroll speed over an 80 ms window (#4329)
  feat(solo): enrich channel menu actions (#4152)
  perf(messages): drop the :has() rules that restyled every conversation (#4314)
  feat(messages): open threads, details, panels and media inline (#4218)
  feat(conversation): show a page's header actions in the workspace toolbar (#4072)
  Deliver agent-only DMs to desktop agents (#4065)
  fix(notifications): keep archived and hidden channels off the Dock dot (#4103)
  ci: parallelize unread browser journeys (#4296)
  ci: parallelize independent history-loading journeys (#4289)
  ...

Signed-off-by: Will Pfleger <wpfleger@block.xyz>
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.

3 participants