镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Closed
baxen wants to merge 0 commit into
baxen/agent-working-reactionsfrom
baxen/agent-local-typing
Closed

baxen wants to merge 0 commit 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
baxen force-pushed the baxen/agent-local-typing branch from 8d2bcec to 687c8e7 Compare October 11, 2026 18:17
baxen added a commit that referenced this pull request Oct 11, 2026
Mirror baxen/agent-local-typing at 8d2bcec5d (#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.

1 participant