agentd watch: human-readable persistent log streaming

t-799·WorkTask·
·
·
Created3 days ago·Updated3 days ago·pipeline runs →

Description

Edit

Rework agentd watch <agent-id> for persistent sessions to tail session JSONL logs and render human-readable progress, not raw JSON lines.

Goals:

  • Keep streaming behavior (follow) while improving readability.
  • Normalize mixed event schemas currently found in persistent session logs:
  • chat/session events (type=message, nested role/content, toolCall blocks)
  • trace-style runtime events (infer_start, tool_call, tool_result, infer_end, custom, checkpoint)
  • Provide concise defaults and opt-in detail.
  • Keep multi-agent watch usable (run-id prefixes).

Key UX requirements:

  • Default output should be one-line summaries with local timestamp and semantic labels.
  • Truncate noisy fields (thinking signatures, full tool outputs, giant prompts).
  • Preserve access to raw mode for debugging.

Timeline (4)

🔄[human]Open → InProgress3 days ago
💬[human]3 days ago

Implemented human-readable persistent watch output for agentd watch <agent-id>.

Changes in Omni/Agentd.hs:

  • Replaced persistent watch raw-stream path with a session-jsonl formatter pipeline:
  • tail complete JSONL lines
  • parse tolerant mixed schemas
  • render compact human-readable output with local HH:MM:SS + [agent-id] prefix
  • Added concise default formatting for persistent events:
  • session/model/thinking level changes
  • infer_start / infer_end metrics
  • tool_call / tool_result with short command/output previews
  • checkpoint and custom events
  • message events (user / assistant / toolResult)
  • Added --details behavior for persistent watch:
  • longer previews and raw fallback for unknown JSON objects
  • Kept multi-agent watch behavior via prefixed output lines.
  • Updated watch option help text to reflect concise vs detailed output.
  • Added unit tests for persistent watch formatter rendering:
  • formats user messages
  • formats tool calls

Verification:

  • typecheck.sh Omni/Agentd.hs
  • lint Omni/Agentd.hs
  • bild --test Omni/Agentd.hs
  • Manual smoke checks:
  • timeout 2s agentd watch sd-coder --mode persistent
  • timeout 2s agentd watch sd-coder --mode persistent --details
  • timeout 2s agentd watch --mode persistent
🔄[human]InProgress → Review3 days ago