Files
buzz/crates
morgmart f158fdd9a1 feat(relay): name the agent whose add policy refuses a DM (#9601)
## Problem

When an agent's add policy refuses a DM open or add (from #9125), the
refusal says only that an agent refused. The person can't tell which
agent blocked it, so they don't know whose owner to ask.

## Change

The DM refusal now ends with `(agent <hex pubkey>)` for the first agent
refused, in the order the request named them. For example:

`forbidden: policy:owner_only — only the agent owner can add this agent
(agent 3f9a…)`

The prefix is unchanged, so existing clients that match on
`policy:owner_only` or `policy:nobody` keep working. Desktop and mobile
follow-ups will show the agent's name.

## Tests

- `adding_an_agent_follows_its_add_policy` asserts the full refusal
including the agent.
- `opening_with_several_agents_follows_their_add_policy` adds a second
refusing agent and checks the first one named is reported.
- DM Postgres tests: 297/297 passed. Clippy is clean.

🤖 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>
2026-11-17 11:26:25 -08:00
..