Skip to main content
A “run” is one agent execution — orchestrator picks up an assignment, exec’s the CLI, the run ends with one of COMPLETED / FAILED / CANCELLED / TIMEOUT. Since PR #234 the legacy agent_runs table is gone; runs are reconstructed from the Crew Journal by grouping journal_entries on trace_id (which equals the run id). The HTTP shape is preserved — frontend consumers don’t see a contract change. Every endpoint is workspace-scoped via the session context.
Runs are read-only — there is no write endpoint. A run comes into existence when the orchestrator emits run.started and concludes when a terminal run.{completed|failed|cancelled|timeout} lands on the same trace_id.

Endpoints


List runs

Returns a paginated list of runs with KPI tiles (stats) and pagination metadata. Backed by journal.ListRuns (CTE-grouped over journal_entries keyed on trace_id) plus journal.RunStats for the tiles. Query parameters: Response: 200 OK
Errors:

Fleet insights

Returns a fleet-operations aggregate over all runs in the workspace for a time window — including ad-hoc agent/chat runs, not just routine invocations. Backed by journal.RunInsights; the handler resolves per-agent counts into a crew rollup and a display-named top-agents leaderboard (one workspace-scoped agentscrews join). Query parameters: Response: 200 OK

Get a single run

Returns a single run by trace id. The response shape is identical to one element of the data[] array from GET /api/v1/runs — the handler reuses the same enrichment so dashboard detail views can share the row renderer. Path parameters: Response: 200 OK
The handler uses the workspace-scoped indexed journal.GetRunByID lookup. A trace ID from another workspace is treated as not found.

Tenancy

  • workspace_id is taken from the session context — never from a query parameter.
  • Cross-tenant trace IDs are filtered out at the journal store (journal.ListRuns requires a non-empty WorkspaceID).
  • Enrichment lookup (agents + crews) is workspace-scoped, so an agent ID collision across workspaces (test fixtures, restored backups) cannot attach foreign names to a row.