Interactive Agent Web Interface

t-694·Epic·
·
·
Created1 month ago·Updated1 week ago·pipeline runs →

Execution Summary

1/12
Tasks Completed
$0.00
Total Cost
0s
Total Time

Design

Edit

Interactive Agent Web Interface

Replace the current tmux/ssh-based interactive agent workflow with a web interface. This builds on the existing Omni/Agentd daemon (which manages pi agents via HTTP API) and the Pipeline web UI (which shows automated agent runs).

Current State

  • Agentd Daemon (Omni/Agentd/Daemon.hs): HTTP API at port 8400 for spawning/managing pi agents. Has spawn, send, stop, list, status endpoints. Uses SQLite for persistence. Manages git worktrees for agent workspaces.
  • Agentd Studio (Omni/Agentd/Studio.hs): Standalone web UI at port 8090. Has its own design system (separate from Omni.Web.Style). Shows agent runs, memory, notes, tasks.
  • Pipeline Web (Omni/Pipeline/Web.hs): Integrated into main Omni.Web at /pipeline. Uses shared design system (Omni.Web.Style). Shows automated pipeline runs with JSONL event parsing, htmx live polling.
  • Main Web (Omni/Web/Core.hs): Unified server routing tasks, pipeline, news, fund, files. Nav has: tasks, fund, pipeline, news, files.

Design Decisions

1. Integrate into Omni.Web, not Studio. Studio is standalone; the main web is deployed and has the shared design system, auth, and existing surfaces. The agents UI will live at /agents in the main web. 2. Nav change: Replace "pipeline" with "agents" in the top nav. Pipeline becomes a subnav tab under agents. 3. Backend: The new web surface calls the Agentd Daemon HTTP API for agent management. The daemon already handles spawning, sending messages, stopping, worktrees, etc. 4. Event streaming: Pi outputs JSONL events. The daemon logs these to files. The web UI reads these logs for display, similar to how Pipeline/Web.hs reads pipeline logs. For live updates, use htmx polling (proven pattern from pipeline). 5. Worktrees: Agents work in git worktrees. The web should show the current diff and allow browsing files in the worktree. 6. Review handoff: When interactive work is done, a "send to review" action triggers the existing Pipeline integration flow (verify + cherry-pick into live).

Key Features

  • Dashboard showing all agents (running, idle, completed)
  • Spawn new agents with prompt, optional task association, model selection
  • Live agent output display with collapsible thinking blocks, tool calls, text output
  • Send messages to running/idle agents (the interactive part)
  • View worktree diff and file browser
  • "Send to review" to hand off to the pipeline integration flow
  • Steering: inject guidance between iterations
  • Cost tracking per agent

Child Tasks

  • t-694.1 - Nav: Replace 'pipeline' with 'agents' in top nav [Done]
  • t-694.6 - Worktree diff view and file browser [Open]
  • t-694.7 - Send to Review: integrate agent work into live branch [Open]
  • t-694.2 - Create Omni/Agents/Web.hs - main agents web surface [Verified]
  • t-694.3 - Agents dashboard page with stats and agent list [Verified]
  • t-694.4 - Agent detail page with event stream, interaction, and collapsible thinking [Verified]
  • t-694.5 - Spawn agent form and POST handler [Verified]
  • t-694.8 - Rich JSONL event parsing and rendering for agent output [Verified]
  • t-694.9 - Delete Omni/Agentd/Studio (failed prior attempt) [Verified]
  • t-694.10 - Agents subnav: interactive + pipeline tabs [Verified]
  • t-694.11 - Agentd daemon HTTP client for web server [Verified]
  • t-694.12 - CSS design for agents web surface [Verified]

Timeline (9)

💬[human]1 month ago

Note: Omni/Agentd/Studio (Studio.hs + Studio/) is a failed prior attempt at this and should be deleted as part of this project. The new agents web UI will live in Omni/Agents/Web.hs integrated into the main Omni.Web server, not as a standalone app.

🔄[human]Open → InProgress1 month ago
💬[human]1 month ago

Implemented major fixes from design critique:

1. Don't delete worktrees on completion — Removed cleanupWorktree from monitorPiAgent success path and stopAgentProcess. Worktrees persist until explicit merge or discard via new API endpoints.

2. Merge/commit action — New POST /agents/:id/merge endpoint: stages all changes, commits in worktree, cherry-picks into parent repo, cleans up worktree on success. New POST /agents/:id/discard endpoint: deletes worktree without merging. Both have buttons in the agent detail page header.

3. DELETE /agents/:id/worktree — New endpoint for explicit worktree cleanup.

4. SSE (Server-Sent Events) — New GET /agents/:id/events endpoint replaces 3s htmx polling. Streams thread entries, working indicators, status changes, cost updates, and diff stats as SSE events. Uses htmx-ext-sse on the client. Updates arrive within ~1 second instead of 3.

5. LLM title generation — New Omni/Agents/Summarize.hs module using Haiku to generate 5-8 word titles for agents. Called async on first agent_end. Stored in DB (new title column). Shown in dashboard cards and detail page header instead of hex run IDs.

6. Tab/title notifications — document.title updates to show red dot when agent goes idle (waiting for input). Uses MutationObserver on status badge.

7. Auto-expand tools during live work — Working indicator uses renderToolActionOpen (details with open attribute). Completed turns still show tools collapsed.

8. Mobile compose fix — Textarea auto-grows via oninput handler (up to 200px). Font size 16px on mobile prevents iOS zoom. Send button has 44px minimum touch target. Header wraps on narrow screens.

9. File change summary in header — git diff --shortstat shown as badge next to diff button. Updated via SSE diffstat events.

10. Better agent naming — Dashboard cards show LLM-generated title prominently, run ID shown smaller below. Detail page uses title as page title.

11. Flexbox thread container — Replaced calc(100vh-200px) with proper flexbox: body is flex column, thread-container has flex:1, thread has overflow-y:auto. No magic numbers.

12. SSE hidden targets — SSE swap targets are display:none divs that forward content to visible elements via hx-target attributes.

🔄[human]InProgress → Review1 month ago
💬[human]1 week ago

Ava verified: implementation present in live tree (file/feature confirmed via inspection). Moving to Verified.

🔄[human]Review → Verified1 week ago