Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions docs/code/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ The standalone command reads the database in read-only mode, so it is safe to ru

## What it shows

- **Run list**: every run with its status, task key, origin (tracker task or PR mention), agent harness, PR link, and duration. Filter by status or origin.
- **Run detail**: a stage-by-stage timeline for one run: the feasibility verdict, the implementation summary, each self-review iteration, each human change request and how it was handled, and the final outcome.
- **Stats**: runs per week, success and escalation rates, median run duration, and a per-harness breakdown over a selectable window (7, 30, or 90 days, or all time).
- **Run list**: every run with its status, task key, origin (tracker task or PR mention), agent harness, PR link, duration, and known cost. Filter by status or origin.
- **Run detail**: a stage-by-stage timeline for one run: the feasibility verdict, the implementation summary, each self-review iteration, each human change request and how it was handled, and the final outcome. Runs that reported token usage also show the model, token totals (input / output), and cost (only when the harness reported one).
- **Stats**: runs per week, success and escalation rates, median run duration, aggregate token usage and known spend, and a per-harness breakdown (including per-harness spend) over a selectable window (7, 30, or 90 days, or all time).
- **Worker status**: whether the daemon is running, queued and failed events, open agent PRs, and per-source poll cursors.

Success and escalation rates are computed over finished runs only. Run duration is measured from pickup to PR creation and is a proxy for ticket-to-PR time. Merge rate is not shown yet: the worker records PRs as open or closed but does not track merges separately.

### Usage and cost data quality

Token/cost accounting depends on what each harness CLI reports: usage is captured only from structured JSON output (e.g. `--json` / `--output-format json` modes), and CLIs that don't emit it show no usage at all rather than zeros. Wherever data is partial, the dashboard says so explicitly — unknown costs render as "unknown" (never `$0.00`) and incomplete accounting is marked "(partial)". Aggregate stats sum only *known* values and show an explicit partial-data notice when runs in the window have missing or unpriced usage.

## Options

| Option | Description |
Expand Down
12 changes: 12 additions & 0 deletions packages/agent-harness/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ export { detectMaxTurnsReached, findMaxTurnsReachedLine } from "./detect-max-tur
// Usage/rate-limit detection
export { detectUsageLimit, resetHintToMs, type UsageLimitResult } from "./detect-usage-limit.js";

// Normalized token/cost usage extraction
export {
extractAgentUsage,
findJsonUsageObjects,
mergeAgentUsages,
normalizeJsonUsage,
type AgentUsage,
type MergedAgentUsage,
type UsageExtractionInput,
type UsageSource,
} from "./usage.js";

// Incomplete implementation detection
export {
detectIncompleteImplementation,
Expand Down
Loading