Rich JSONL event parsing and rendering for agent output

t-694.8·WorkTask·
·
·
·Omni/Agents/Events.hs
Parent:t-694·Created1 month ago·Updated1 week ago·pipeline runs →

Description

Edit

Parse and render the full JSONL event stream from pi agents with high fidelity.

The current Pipeline/Web.hs event parser is lossy — it truncates thinking to 200 chars, tool args to 80 chars, tool results to 200 chars. For the interactive agent UI we need the full output to be visible.

Event Types to Parse

From pi's --mode json / --mode rpc output:

1. agent_start — Agent session began 2. turn_start — New inference turn 3. message_start — LLM response started 4. message_update with assistantMessageEvent:

  • thinking_start — Thinking block opened
  • thinking_delta — Incremental thinking text
  • thinking_end — Thinking block closed (has full content)
  • text_start — Text output started
  • text_delta — Incremental text
  • text_end — Text output complete (has full content)
  • tool_call_start — Tool call initiated (has toolCall.name, toolCall.input)
  • tool_call_delta — Incremental tool input
  • tool_call_end — Tool call complete
  • tool_result — Tool execution result (has toolCall.output)

5. message_end — Full message with usage/cost data 6. turn_end — Turn complete 7. agent_end — Agent session complete (has full message history)

Rendering

  • Thinking: Full content in collapsible <details> element. Summary shows first 100 chars.
  • Tool calls: Show tool name prominently. For Read/Bash/Edit/Write, show structured args:
  • Read: file path
  • Bash: command text (full, in <pre>)
  • Edit: file path + old/new text snippets
  • Write: file path + content length
  • Tool results: Full output in collapsible <details>. Summary shows first line or result type.
  • Text output: Full assistant text, rendered with basic markdown (paragraphs, code blocks, lists).
  • Turn boundaries: Visual separator with turn number and cost delta.
  • Cost tracking: Running total displayed at each turn boundary.

Module

Create Omni/Agents/Events.hs with:

  • data AgentEvent — Richer than Pipeline's version
  • parseEventLog :: Text -> [AgentEvent] — Parse full JSONL
  • renderEventList :: [AgentEvent] -> Html () — Render to HTML
  • renderEvent :: AgentEvent -> Html () — Render individual event

Timeline (4)

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

Ava verified: shipped as part of commit b05c4976 'agents web ui: interactive agent interface'. /agents endpoint live on beryllium and returns 200. Moving to Verified.

🔄[human]Review → Verified1 week ago