agentd: remove workspace abstraction, improve list-runs/logs/status CLI

t-469·WorkTask·
·
·
Created1 month ago·Updated4 weeks ago

Description

Edit

Overview

Remove the outdated --workspace abstraction from agentd CLI and improve the list-runs, logs, and status commands to use the new /var/log/agentd/<run-id>/ structure.

Changes Needed

1. agentd list-runs (no args required)

  • Scan /var/log/agentd/ for all run directories
  • Display: run-id, start time, completion status, total cost & iterations
  • Completion status determined by parsing events.jsonl for terminal events:
  • EventComplete → "completed"
  • EventError → "error"
  • EventGuardrail → "guardrail"
  • No terminal event → "running"

2. agentd logs <run-id>

Hybrid approach:

  • If container is running: pass through to podman logs
  • If container stopped: read /var/log/agentd/<run-id>/events.jsonl and pretty-print events (EventThinking, EventToolCall, etc)

3. agentd status <run-id> (remove --workspace arg)

  • Read from /var/log/agentd/<run-id>/events.jsonl
  • Show completion status (parse last event)
  • Show cost/tokens/iterations
  • Show any errors/guardrails hit

4. Remove workspace abstraction

  • Remove --workspace flag from all commands
  • Update all code that references workspaces
  • Use run-id as primary identifier throughout

Rationale

  • Simplifies UX: users only need run-id, not workspace paths
  • Uses persisted logs for completed runs (container logs may disappear)
  • list-runs becomes the discovery mechanism for historical runs
  • logs command provides human-readable event replay instead of raw json

Timeline (6)

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

Discovered multiple missing global Haskell deps (yaml, fsnotify). Need to add to Omni/Bild/Deps/Haskell.nix and rebuild from live worktree. This is a build system issue, not directly related to agentd CLI changes.

💬[human]1 month ago

Build fails due to nix build system not finding fsnotify even though it's in Haskell.nix. This is a deeper build infrastructure issue unrelated to the code changes. The code refactor is complete, but we can't build/test until build system is fixed. Committing work-in-progress.

🔄[human]InProgress → Done4 weeks ago