mirror of
https://github.com/block/buzz.git
synced 2026-11-02 23:41:08 +00:00
## Summary
Mobile's Agents modal listed agents that desktop does not show. Most
were agents created in the earlier Buzz app (this repository's
`desktop/`), which the owner had not imported into Buzz 1.0
([block/buzz-app](https://github.com/block/buzz-app)). @ completion
offered them as well.
Desktop lists an owned agent only when the owner's newest kind:30177
record for that agent has a `pluginId/typeId` `runtime` tag and a name.
Records written by the earlier app have no `runtime` tag. Importing an
agent on desktop republishes its record with one
([`listingsOf`](662e91800a/src/features/agents/service.ts (L1413-L1460))).
Mobile now applies the same rule:
- **Agents modal:** shows listed owned agents, plus the account's remote
agents that have a verified owner profile here (so one stays listed
while a deletion that already removed its registration is retried).
Owned kind:10100 directory entries no longer add agents on their own.
- **@ completion:** channel members are always offered. Listed owned
agents are offered in streams and forums, where they can be added, as on
desktop. An owned agent that isn't listed is no longer offered from the
directory or from search, because mobile can't import it. The check that
runs before sending a restored draft follows the same rule.
The owned-agent directory moved to `lib/shared/agents` so the channels
feature can use it.
Shared agents owned by other people still come from the kind:10100
directory, which desktop doesn't use for @. That difference is unchanged
here.
### Related issue
None found.
### Validation
iPhone 17 simulator, debug build, against a local relay seeded with one
owner and two owned agents. Both agents have a NIP-OA profile. "Current
Agent" has a desktop runtime tag. "Old App Agent" has a registration
written the way the earlier app writes it, with no runtime tag. The
before captures are `origin/main` with the same data.
| | Before | After |
| --- | --- | --- |
| Agents modal | 
| 
|
| `@` in a stream | 
| 
|
| `@Old` in a stream | 
| 
|
Added tests:
- Directory loading: remote, desktop, earlier-app, later-imported, and
reverted agents, plus agents owned by someone else; only the newest
record counts. A table test covers the runtime and name rule.
- Agents modal widget test: an earlier-app agent is not shown.
- Mention candidates: only listed owned agents are offered outside the
channel, including from search.
- Compose bar: a restored draft that mentions an unlisted owned agent
outside the channel is rejected before sending.
I disabled the runtime check and the unlisted-agent filter, and the four
new guarding tests failed. The full mobile suite passes.
Human test: not applicable for this mobile change under the author's
standing exception.
buzz-review-completed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Tom Brow <tomb@squareup.com>