Skip to content

feat(web): show encrypted live agent activity - #7

Merged
hardy4yooz merged 3 commits into
hardy4yooz:mainfrom
Realcryptoplato:codex/upstream-agent-activity
Oct 9, 2026
Merged

hardy4yooz merged 3 commits into
hardy4yooz:mainfrom
Realcryptoplato:codex/upstream-agent-activity

Conversation

@Realcryptoplato

Copy link
Copy Markdown
Contributor

Closes #6.

Outcome

Buzz Web now shows best-effort live agent execution state after a user posts a message, instead of looking dormant while a remote agent works. The compact indicator distinguishes Working, Thinking, Using a tool, Responding, Quiet, Reconnecting, Disconnected, and signer-unavailable states. Quiet is deliberately not described as a stall.

The feature is portable protocol work: it requires no private endpoint, Relay configuration flag, deployment change, or Agent Control change.

Protocol and security

  • Subscribes persistently to ephemeral Nostr kind 24200 with #p scoped to the authenticated owner.
  • Requires exactly the owner/agent/telemetry envelope semantics, verifies the Nostr signature, and requires event.pubkey === agent.
  • Rejects senders outside the Relay's known agent membership before invoking NIP-44.
  • Decrypts agent-to-owner content locally through imported local identities or NIP-07 signers with NIP-44.
  • Tracks observer subscription readiness/retry/closure separately from the general Relay socket.
  • Uses explicit channelId first; unscoped turn/session correlation is accepted only while it maps uniquely to one channel.
  • Caps ciphertext, plaintext, batch size, identifiers, dedupe state, correlations, submissions, and retained frames.
  • Keeps activity in browser memory only and never transmits decrypted observer content elsewhere.
  • Verifies fresh status against the latest submission so a previous turn's command is not shown as current.

Presentation

  • Adds a fixed-height, accessible indicator below the active timeline, avoiding composer layout shift.
  • Suppresses duplicate agent typing only while the observer lane is demonstrably healthy; typing remains the compatibility fallback.
  • Adds a resizable desktop/iPad panel and an opaque full-width mobile panel.
  • Shows a conservative semantic allowlist: lifecycle state, tool name, and bounded shell command.
  • Redacts common credential forms, 64-hex secret material, Bearer values, and absolute paths.
  • Does not render raw output, message/thought content, arbitrary tool arguments, or protocol JSON.
  • Adds English and Simplified Chinese copy and protocol documentation.

Synthetic screenshots

Desktop, mobile, and Simplified Chinese screenshots were generated from the repository demo fixtures. They are intentionally not committed; they will be attached to this draft PR conversation.

Verification

  • cd web && npm ci
  • npm run typecheck — passed
  • npm test — 24 files, 97 tests passed
  • npm run check — passed
  • npm run build — passed
  • npm run test:e2e — 35 tests passed
  • cd ../agent-control && npm ci && npm test — 3 tests passed
  • git diff --check — passed

All protocol and browser tests use generated keys and synthetic fixture content only.

Draft questions / limitations

  • Please confirm that kind 24200 is intended as a stable public Web-client contract.
  • The implementation conservatively drops unscoped activity when a session or turn becomes cross-channel ambiguous.
  • Runtimes that do not emit observer frames degrade to typing presence.
  • NIP-07 providers without NIP-44 show an unavailable state.
  • Persistent history, raw protocol JSON, raw tool output, transcript coalescing, and control-plane actions are intentionally out of scope. A richer inspector should be a separate proposal with an agreed typed redaction contract.

Signed-off-by: Greg Lindberg <greglindberg@gmail.com>
@Realcryptoplato

Copy link
Copy Markdown
Contributor Author

Synthetic fixture screenshots

Desktop

Agent activity panel on desktop using synthetic demo data

Mobile

Agent activity panel on mobile using synthetic demo data

Simplified Chinese

Localized agent activity panel in Simplified Chinese using synthetic demo data

All content shown here comes from repository demo fixtures.

@hardy4yooz
hardy4yooz marked this pull request as ready for review August 14, 2026 14:27
@hardy4yooz

Copy link
Copy Markdown
Owner

Thank you for the substantial implementation and the careful documentation. Kind 24200 is now documented by upstream as the draft, optional NIP-AO observer protocol, and the latest web and agent-control checks both pass.

We are holding the merge for now because a few correctness and privacy cases still need to be resolved:

  • NIP-AO requires exactly one p, agent, and frame tag, requires payload, and requires clients to ignore unknown frame kinds. The current parser accepts duplicate routing tags and missing payloads, and it presents unknown kinds as activity.
  • The plaintext limit must be measured in UTF-8 bytes (maximum 65,535), and the live subscription should start with since set to the current time rather than requesting an unbounded filter.
  • The shell-command summary redaction still exposes common credential forms, including prefixed API-key variables, database URLs with credentials, flag-style passwords, and Basic authorization values. For this surface, omitting raw commands or using a strict structured allowlist would be safer than trying to redact arbitrary shell text.
  • Observer health currently suppresses typing for every channel agent, including agents that do not emit observer frames. A normal top-level message also marks every channel agent as submitted, while thread sends are not marked. This needs per-agent fallback, targeted submission tracking, and thread parity.
  • The unconditional one-second state tick rerenders the workspace even when no activity is visible; it should run only while an expiry or active status needs updating.

These are runtime behavior and privacy issues rather than CI failures. Please add focused tests for the protocol rejection cases, credential forms, mixed observer/non-observer agents, untargeted messages, and thread sends. The feature direction is useful, and I will be happy to re-review an updated version. Thank you for the work on this.

@hardy4yooz
hardy4yooz merged commit d05e130 into hardy4yooz:main Oct 9, 2026
2 checks passed
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.

Design: owner-scoped live agent activity in Buzz Web

3 participants