Files
ai-agent/backend/agents.py
Gabriel Vidal b79d639759 feat(agents): an agents catalog with per-agent stats and a run/schedule CTA
Files gains an `/agents` page next to Skills: every `.claude/agents/**/*.md`
definition plus the built-in types the transcripts saw run, fuzzy-searchable
with a totals dashboard, and a detail page per agent.

Unlike a skill, an agent run is a *whole conversation*, so the money here is
measured rather than estimated. `_build_agent_runs` unifies two origins into
one run list: subagent runs (a sidechain transcript whose `agent-*.meta.json`
names the agentType, credited to its parent) and session runs (a cron firing,
or the new "Run now").

The detail page carries stat cards (runs, spend, avg/run, last run), a runs-
per-day strip, the run history, the definition, and the two CTAs — Run now
(same path a cron firing takes) and Schedule (creates the cron job on that
definition). A conversation launched that way is stamped `agentRun` and gets
an AgentBadge linking back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 22:07:51 +02:00

9.4 KiB