Skip to content

feat(agents2): show an agent typing on this device while it works - #861

Closed
baxen wants to merge 22 commits into
baxen/agent-working-reactionsfrom
baxen/agent-local-typing
Closed

baxen wants to merge 22 commits into
baxen/agent-working-reactionsfrom
baxen/agent-local-typing

Conversation

@baxen

@baxen baxen commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

What

STOPGAP, to be deleted once agents' typing pulses reach the relay (#792 plus block/buzz#8207). While an Agents2 agent works on a mention (the same lifetime as #860's reactions, Agents2Service.working()), this device shows the agent typing in the mention's thread. Nothing is published, so other devices don't see it.

  • agents2/local-typing.ts builds a kind 20002 pulse every 3 s. It uses the tags feat(agents2): show agents as typing while they work on a mention #792 would publish: h, the thread root, and the mention as reply.
  • The new typing.local(event) in relay/typing.ts feeds that pulse into the session's existing typing store as if it came live. The store's expiry (8 s), the end-on-reply rule (the agent's kind 9 hides the indicator, then a 2 s quiet period) and the existing indicators all work unchanged.
  • The session is the same per-community session the UI uses (communities.open → acquire). Agents2 agents are already in agentChoices through localAgents.bind(agents2.local), so the floating indicator and the thread rows show them.
  • No FOUNDATION file changes: relay/session.ts already exposes typing.capability.

Removal

Every piece is tagged STOPGAP(agent-local-typing). Run grep -rn "STOPGAP(agent-local-typing)" src and delete what it marks. #860's reactions are tagged STOPGAP(agent-working-reactions) the same way.

Notes

  • When the turn settles, the host feeds a local kind 9 end, so the indicator clears at once instead of when the last pulse expires (up to 8 s). Codex makes one more model call after a final send, so its indicator can stay about 3 s past its reply.
  • The agent's own posts in that thread (progress updates) don't hide it, so it doesn't blink off for 2–5 s after each one. Only the local end does.
  • A failed pulse warns once, then stops pulsing; it never breaks the run.
  • typing.local sits on the session's typing capability, so code that can see the session could show fake typing for any pubkey. It only affects this device.

Validation

  • vitest run across agents2, relay typing and activity-typing, Codex, Claude Code and TypingIndicator: 22 files / 244 tests pass. tsc --noEmit is clean.
  • New tests:
    • a local pulse shows like a live one and the agent's reply ends it
    • pulses come every 3 s in the mention's thread and stop when told to
    • a pulse is skipped while the community is not ready
    • a throwing pulse stops the pulses
    • the service starts typing for a mention run
    • stopping ends the indicator at once, and a local end hides it like a reply
  • Not yet done: a re-test after baxen's first test (which found the 8 s tail, now fixed).

🤖 Generated with Claude Code

baxen and others added 21 commits October 11, 2026 10:06
Store optional picture and about fields on Agents2 identities and publish them with the name. Track accepted metadata so updates and clears publish even without a rename. Preserve compatibility with older rows and publication receipts.

Implemented with goose AI assistance. Human acceptance: green confirmed working.

Signed-off-by: Bradley Axen <baxen@squareup.com>
Agents2 can now take over an identity that the harness controller or
old Buzz (installed or dev) saved on this machine. It keeps the key,
name and picture, and leaves the instructions and settings behind.
Neither old store is written.

- port.rs lists both stores as one flat list, one entry per key. The
  harness copy wins because its key is already in this app's store.
  It also re-reads an identity and its key at take-over time.
- AppAgents::adopt is prepare with an existing key. When a harness
  agent saved for the same community already holds the key under the
  same credential ID, commit shares that key and never adds or
  withdraws it. Without this, a failed add would have deleted the
  harness copy.
- An adopted agent keeps the profile its community already has.
  Without one, it publishes the name and picture it brought. If the
  read fails, it overwrites nothing until the agent is renamed.
  Agents2 profiles gain an optional picture.
- Adds a "Bring over" side panel on the Agents2 page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
fixup! [agents2-adopt] bring over agents from earlier agent systems

Check an adopted key's community profile under its publication turn, on
the first publication rather than right after bringing it over, so a
sync meanwhile cannot replace it and a failed read is retried. Refuse a
key that is already here or still being removed, never delete a
credential an adopted key may share, read old Buzz's inline keys, and
wait out a busy credential store.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
Adapt adoption to the metadata layer so accepted pictures and descriptions are recorded with the name.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
…d agent-mention popups

Delete the bundled Agents and Channel templates plugins and every v1
mention popup: wake notices, owner-review requests, the mention attach
path in agent control, and snapshot previews. Adding an agent to a
channel no longer starts it.

Settings > Agents keeps only "Remember mentioned agents" and the saved
activity archive. The shell's collapsible-sidebar, retry and icon
special cases move from the v1 Agents page to Agents2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
Plugins now provide profile content. With no profile panel registered,
avatars and names render inert, and mention chips keep their identity
attributes without a button so copy and paste still round-trips them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
…g and security

With the v1 Agents page, Profiles and Channel templates gone, the services
behind them have no consumer. Delete v1 AgentControl and its native bridge,
AgentSecurity, agent snapshots and snapshot sharing, team bundles and
import, the community catalog, the agent-management request lease, and the
channel kit's team payload/text write paths.

Names, mentions and New message now read a LocalAgents snapshot published
by Agents2 (the viewer's own live identities) instead of v1 native control,
so Agents2 agents stay "managed" for DMs and mention invitations. The
plugin author API no longer exports the AgentControl or AgentSecurity
types. Docs drop agent-control.md and agent-security.md and describe the
remaining agent surfaces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
Templates & teams was the only TemplateProviders contributor, so with it
gone the extension point only rendered empty slots and "templates are off"
notes. Remove ctx.channelTemplates and its editor, group-default and
save-as slots from Create channel, the channel menu, Channel settings and
Personal groups. Create now sends name, privacy, duration and destination
group only.

The channel kit model and session setup stay: groups and Canvas depend on
them, and frozen setup receipts saved by earlier builds still retry with
their original agents and Canvas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
…sion point

fixup! [remove-agents-v1-templates] Remove the channel template extension point

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
Nothing in the frontend drives the v1 agent controller any more. Delete
AgentHost and every agent_control_* command, agent_security, native model
discovery (agent/codex/goose/pi models), harness installers and managed
npm, media_snapshot_read, the kit team-catalog reader and the agent
supervisor dispatch, with their build.rs, capability and permission-test
entries, plus the orphaned authorize-agent route in native-api and the
dev broker. Drop the now-unused buzz-agent dependency.

Agents2's app_agent_* commands are unchanged; app_agents.rs now owns the
NIP-98 header helper it borrowed from the v1 module. Quit, update restart
and sign-out no longer wait on a native agent host: Agents2 agents are
plugin host processes that stop when Buzz exits. Sign-out still deletes
keys listed in the v1 agent registry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
Erase kept only the earlier agent registry: "keep agents" wiped
agents2/identities.json, orphaning its keys, and "remove agents" deleted
only keys listed in the earlier registry. Both registries are now kept,
and removing agents deletes the keys of both.

A rename republished an adopted agent's profile with only its name, bot
flag and picture, dropping about, banner, NIP-05 and the rest. It now
reads the community's current profile and changes only the name and bot
flag, adding the picture only where there is none.

The Agents2 grid, peek and build view now show the picture an agent
brought over instead of only its initials.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
Stop building and shipping the unused v1 agent runtime. Keep desktop launch,
application signing, installer verification and AppImage launch repairs.

Trim the controller crate to Agents2 identities, credentials, profile signing
and legacy import. Preserve legacy key deletion with bounded registry reads,
identity validation and controller locking, without retaining the v1 runtime.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
Import authored descriptions and retained pictures from legacy and harness records. Publish ordinary stored metadata and track accepted picture/about changes without a persistent adopted flag or community-profile preservation path. Retain transient shared-key custody protections and compatibility with saved adoption flags.

Implemented with goose AI assistance. Validated on tail with 46 controller unit tests, 5 integration tests, 4 native host tests, formatting and diff checks. Live tail acceptance remains deferred.

Signed-off-by: Bradley Axen <baxen@squareup.com>
Agents2 had no way to set a picture, and its grid, peek and build view
passed raw relay media URLs straight to <img>, which community media
refuses without the media proxy, so even agents brought over with a
picture showed initials.

AppAgents::set_picture (app_agent_set_picture) saves or clears an HTTPS
picture; Agents2.save takes { picture } and republishes the profile
through the existing refresh. The build view's identity rail uses the
shared AvatarEditor (uploads as the owner, like your own profile), and
every agent portrait goes through useAvatarPreview.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
…agents

Removing the Profiles plugin left nothing registering the profile panel,
so mentions and avatars of people and agents no longer opened anything.

Revert that removal, then drop only what served v1 agents: Runtime,
Instances, harness log, start/stop/restart, archive, Memories, Add to
channel, exact-instance targets and the kind-10100 Agent type and
Capabilities rows. Human profiles render as before. Agents2 agents keep
their type's tabs and Delete, and Message for an agent follows the
Agents2 LocalAgents snapshot. Browser fixtures use LocalAgents instead
of AgentControl; v1-only cases are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
Keep the plugin default and persistence assertions without a single-element loop, and remove the duplicate profile field introduced by rebasing overlapping metadata changes. Authored by the goose AI agent.

Signed-off-by: goose <goose@users.noreply.github.com>
Until Agents2 agents show as typing, the host reacts to a mention as the
agent with 👀 and 💬 when its run starts, and deletes both once the run and
the work it handed off have settled (at most the longest run allowed).

Plugins return from `run` early and finish their turns in the background,
so `Delivery.workingUntil(done)` lets them say when that work settles.
Claude Code and Codex now call it. The reactions live in
working-reactions.ts and its one call in the service, so they can be
deleted once typing indicators ship; `workingUntil` stays for those.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
The relay rejects a deletion with more than one target, so the single
deletion naming both reactions was refused and they were never removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
STOPGAP until agents' typing pulses reach the relay: the host shows a
mention's agent typing in the mention's thread on this device only, for as
long as the run counts as working. Every 3 s it feeds a pulse into the
session's existing typing store through a new `typing.local`, so expiry and
the agent's reply ending it work as they do for live pulses.

Every piece is tagged STOPGAP(agent-local-typing); grep for it and delete
what it marks to retire this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
The last pulse kept an agent shown as typing for up to 8s after its
reply, and longer for Codex, which runs one more model call after a
final send. Stopping now feeds a local kind 9 end, the same signal a
relay reply gives, so the indicator clears at once.

STOPGAP(agent-local-typing): delete with the rest of local typing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
Each post an agent made hid its typing, then the 2s post-message quiet
and the 3s pulse interval left it blank for up to 5s before the next
pulse brought it back. While this app drives an agent's typing in a
thread, the agent's own posts there no longer end it; the local end at
the turn's close does.

STOPGAP(agent-local-typing): delete with the rest of local typing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
baxen added a commit that referenced this pull request Oct 11, 2026
Mirror baxen/agent-local-typing at 8d2bcec (#861, stacked on #860, which now carries its STOPGAP tags). Preserve the existing next/green ancestry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
@baxen
baxen force-pushed the baxen/agent-working-reactions branch from 71f044f to 737b32d Compare October 11, 2026 23:11
@baxen

baxen commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator Author

🤖 Folded into #860 (show agents working): local typing now lives there with the 👀💬 reactions and the Codex settle fix from #863. Branch kept.

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