Skip to content

Add LLM Agent UX specification document#11

Merged
intendednull merged 7 commits into
mainfrom
claude/llm-agent-ux-spec-H11cV
Apr 26, 2026
Merged

Add LLM Agent UX specification document#11
intendednull merged 7 commits into
mainfrom
claude/llm-agent-ux-spec-H11cV

Conversation

@intendednull
Copy link
Copy Markdown
Owner

Summary

This PR introduces a comprehensive design specification for LLM-powered agents in Willow. The spec defines how agents integrate as first-class participants in servers, including their identity, UI treatment, interaction model, permissions, streaming responses, and privacy considerations.

Key Changes

  • Agent Identity & Presence: Defines PeerKind enum to distinguish agents from human members, with provider information and presence states (online, thinking, offline)
  • UI Treatment: Specifies agent rendering in member lists (separate "Agents" section), message display (bot badge, agent tag, cleartext notice), and message actions (regenerate support)
  • Interaction Model: Documents three invocation modes (@mention, DM, auto-respond channels), threading behavior, and slash command registration
  • Permissions & Trust: Outlines role-based permission system for agents, trust model via invites, and rate limiting to prevent flooding
  • Streaming Responses: Defines wire format using StreamStart/StreamChunk/StreamEnd content variants with UI behavior and replay semantics
  • Thinking Indicators: Introduces ephemeral Thinking/StoppedThinking messages for real-time feedback during inference
  • Configuration UI: Specifies channel settings panel for per-agent enable/auto-respond toggles and server-wide agent management
  • Privacy & Encryption: Addresses cleartext processing with transparent disclosure and introduces DataPolicy field for data handling transparency
  • Implementation Details: Provides AgentRole worker node architecture, TOML configuration format, new event kinds (SetAgentConfig), and content variants
  • Migration & Compatibility: Ensures backward compatibility with graceful fallbacks for unknown message types and events
  • Implementation Phases: Breaks down development into 5 phases from foundation (identity/UI) through discovery (slash commands)

Notable Implementation Details

  • Agents use standard Ed25519 keypairs and existing role-based permission system
  • Streaming uses HLC-ordered chunks with ephemeral intermediate states (only final message persisted)
  • System prompts stored as server metadata via new SetAgentConfig event
  • Rate limiting at both server and channel levels with configurable defaults
  • Transparent encryption handling: agents receive channel keys but messages show "processed in cleartext" notice
  • Backward compatible: new content variants and event kinds gracefully handled by older clients

https://claude.ai/code/session_01TgUPyTo1tN4UuwNbNXCR8j

intendednull added a commit that referenced this pull request Apr 25, 2026
- Add Status header noting post-state-machine refactor alignment
- §1: clarify PeerKind/SetProfile additions are NEW; spell out the
  proposed extended SetProfile event with optional fields
- §2 Member List: correct section order (Infrastructure → Members today;
  Agents inserted between them) with explicit alternative considered
- §2 Message Rendering: drop the non-existent "verified/role badge"
  comparison; note the bot badge is wholly new UI
- §3 Threading: switch from legacy Content::Reply to canonical
  EventKind::Message reply_to field
- §4 Permissions: rewrite table to match canonical willow_state::Permission
  (drop ReadMessages/ManageMessages/AttachFiles/BanMembers); flag that
  pin/moderate/attach require new Permission variants
- §4 Trust Model: clarify Kick + RotateChannelKey are two separate events
  composed at the client layer, not atomic in the state machine; flag
  optional future EventKind::KickAndRotate
- §5 Streaming: resolve internal contradiction by making chunks pure
  WireMessage (ephemeral) and the final body the only EventKind::Message
- §6 Indicators: replace fictional EphemeralMessage enum with new
  WireMessage variants alongside existing TypingIndicator
- §9 Worker Node: clarify WorkerRole is a trait and WorkerRoleInfo is a
  separate enum; rename Agent → Bot to match existing future-marker;
  keep WorkerRoleInfo capacity-only (identity stays on Profile);
  correct gossipsub topic claim (no per-channel topic; uses _willow_server_ops)
- §10: state machine no longer carries stream variants on Content
- §11: replace fictional ApplyResult::Skipped and "[unsupported message
  type]" claims with real bincode-tagged-enum behavior; propose
  EventKind::Unknown / WireMessage::Unknown forward-compat catch-alls
- §12: add Phase 0 (forward-compat foundation) and Phase 6 (optional
  atomic Kick+Rotate); note current PR worktree has no agent crate
- §9 Configuration: note crate state caveat (none in this PR worktree)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
claude and others added 5 commits April 25, 2026 02:10
Covers identity (PeerKind), UI treatment (bot badges, streaming messages,
collapsible responses), interaction model (@mention, threading, slash
commands), permissions, privacy/encryption transparency, and the agent
worker node implementation. Phased into 5 stages from foundation through
discovery.

https://claude.ai/code/session_01TgUPyTo1tN4UuwNbNXCR8j
- Agent dangerous permissions (Admin, KickMembers, etc.) are allowed but
  gated behind a confirmation dialog instead of hard-blocked.
- Agents use the same E2E encryption as human members — no special
  cleartext mode. The only distinction is the data policy (local vs cloud)
  which determines what happens post-decryption.

https://claude.ai/code/session_01TgUPyTo1tN4UuwNbNXCR8j
- Add Status header noting post-state-machine refactor alignment
- §1: clarify PeerKind/SetProfile additions are NEW; spell out the
  proposed extended SetProfile event with optional fields
- §2 Member List: correct section order (Infrastructure → Members today;
  Agents inserted between them) with explicit alternative considered
- §2 Message Rendering: drop the non-existent "verified/role badge"
  comparison; note the bot badge is wholly new UI
- §3 Threading: switch from legacy Content::Reply to canonical
  EventKind::Message reply_to field
- §4 Permissions: rewrite table to match canonical willow_state::Permission
  (drop ReadMessages/ManageMessages/AttachFiles/BanMembers); flag that
  pin/moderate/attach require new Permission variants
- §4 Trust Model: clarify Kick + RotateChannelKey are two separate events
  composed at the client layer, not atomic in the state machine; flag
  optional future EventKind::KickAndRotate
- §5 Streaming: resolve internal contradiction by making chunks pure
  WireMessage (ephemeral) and the final body the only EventKind::Message
- §6 Indicators: replace fictional EphemeralMessage enum with new
  WireMessage variants alongside existing TypingIndicator
- §9 Worker Node: clarify WorkerRole is a trait and WorkerRoleInfo is a
  separate enum; rename Agent → Bot to match existing future-marker;
  keep WorkerRoleInfo capacity-only (identity stays on Profile);
  correct gossipsub topic claim (no per-channel topic; uses _willow_server_ops)
- §10: state machine no longer carries stream variants on Content
- §11: replace fictional ApplyResult::Skipped and "[unsupported message
  type]" claims with real bincode-tagged-enum behavior; propose
  EventKind::Unknown / WireMessage::Unknown forward-compat catch-alls
- §12: add Phase 0 (forward-compat foundation) and Phase 6 (optional
  atomic Kick+Rotate); note current PR worktree has no agent crate
- §9 Configuration: note crate state caveat (none in this PR worktree)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Phase 1 checklist marked "Add collapsible long messages (already
shipped)", but the body-collapse / "Show more" toggle does not exist in
crates/web/src/components/message.rs on main. Re-flag it as net-new
work so the phase plan reflects reality.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@intendednull intendednull force-pushed the claude/llm-agent-ux-spec-H11cV branch from 718cbc1 to 8f01502 Compare April 25, 2026 09:11
intendednull and others added 2 commits April 25, 2026 02:26
- Profile/UpdateProfile/ProfileDelta acknowledged; peer_kind/data_policy
  added there (not on legacy SetProfile) following the established
  serde-default extend-pattern from the 2026-04-19 profile-card work
- Permission: 5 actual variants; Administrator/KickMembers replaced
  with governance via state.is_admin() + ProposedAction
- KickMember spelled as Propose { action: ProposedAction::KickMember }
  in §4 trust model and §7 server settings
- ApplyResult: 3 actual variants (Applied/Rejected/AlreadyApplied)
- reply_to: Option<EventHash>; final_event_id: EventHash;
  SetAgentConfig.peer_id: EndpointId
- Per-channel topics acknowledged (channel_topic, voice_topic);
  prefer typed network::topics::* over string constants
- Distinguish proposed willow-bot worker (new crates/bot) from existing
  willow-agent MCP crate (crates/agent)
- Encryption: open design question for EventKind::Message.body vs
  SealedContent surfaced in §3 + §8
- Unknown variants: bincode tagged-enum limitation acknowledged;
  versioned-envelope (Option B) preferred over custom Deserialize
- WorkerRoleInfo::role_name() non-exhaustive match arm + PartialEq
  considerations called out
- SetAgentConfig admin gate routed through admin-only matches! block
  in check_permission, NOT required_permission()
- Regenerate = DeleteMessage + new Message; author-only delete
  contract documented (state machine currently lacks the gate)
- Phase 6 atomic Kick+Rotate framed as ProposedAction (preferred) vs
  top-level EventKind tradeoff

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- State machine already enforces author-only DeleteMessage; spec proposal LOOSENS to moderators (not tightens)
- Owner-override cite: check_and_apply_proposal at materialize.rs:188-209
- role_name() match wording: exhaustive today, new variant requires matching arm
- UpdateProfile cite tightened to event.rs:150-168

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@intendednull intendednull merged commit d95eb0b into main Apr 26, 2026
5 checks passed
@intendednull intendednull deleted the claude/llm-agent-ux-spec-H11cV branch April 26, 2026 07:24
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