Oko/Docs

Command reference

oko stats models

Which model does the work, best and fastest: one row per model with the agent time active on it, the tasks judged done and the defects repaired or closed while a session ran it, the tasks reopened afterwards, the median time from a task's operator message to its done verdict, agent time, tokens and cost per item and per done task, the median time from a defect's assignment to its repair, and the quality of that work — repairs taken back, records withdrawn as made in error, defects later found in its commits, and pushes refused against commits made. Oko Desktop's Activity screen shows the same table under Models, with a field for the hours, and the model policy reads it.

Invocation#

Command
oko stats models [--hours N] [--root DIR ...] [--json]

Inputs and options#

  • --hours N: the last N hours, a positive whole number; all history when omitted.
  • --root, repeatable: transcript roots to read; every root `oko lake survey` describes when none is named.
  • --json: the rating as JSON instead of one paragraph per model.

Output and state effect#

  • Active time is each transcript's assistant records per model, joined into stretches by the break rule of `oko telemetry work`; tokens are input, output and cache writes, cost is the list price of all four counters from the token pricing catalogue, marked `costExact: false` for a nearest price and `unpriced` when a model has none.
  • A done verdict (`oko_task_verdicts`, outcome done) counts for the model its task's session ran at `judged_at`; its time to done runs from the task's operator message (`oko_tasks.at`, kind task) to that verdict. A task reopened is a defect recorded against it (`oko tasks defect`, `oko_task_defects`), counted for the model its session ran at `reported_at`. A defect repair or close counts for the session whose transcript ran `oko defects repaired|fix <id>` last before the register's `repaired_at`|`fixed_at`, under the model it ran then; a withdrawn record for the session whose `oko defects record` printed its identifier; a repair or closing taken back (the defect's typed `reopened` lifecycle event, whose state before it names when the original was recorded) for the session that recorded the original. Assignment-to-repair time is from the defect's last `assigned` lifecycle event before the repair. A command is read from a shell call's command line as words, each statement alone from the word that runs the program, so a line that only mentions a command (an echo, a search, a document) does not count.
  • Pushes are shell lines that run `git push`, refused when the tool reported the call failed; commits are shell lines that run `git commit` and that git answered with `[<branch> <hash>]`. A defect recorded later as found in `<repository>@<commit>` whose commit starts with one of a model's commit hashes counts for that model under defectsFoundInCommits.
  • Anything no transcript traces to a model is counted in the `unattributed` row, never given to a model. A ratio over nothing is null (`none` in text), never zero.
  • JSON: `{generatedAt, since, windowHours, transcripts, unreadable:[{path, cause}], models:[row], unattributed: row}`; each row carries `model, activeSeconds, tasksDone, defectsRepaired, defectsFixed, tasksReopened, medianSecondsTaskToDone, tasksTimed, tokensPerTask, costPerTaskUSD, items, agentSecondsPerItem, medianSecondsAssignmentToRepair, repairsTimed, tokens, costUSD, costExact, unpriced, tokensPerItem, costPerItemUSD, repairsWithdrawn, recordsWithdrawn, pushes, pushesRefused, commits, pushRefusalsPerCommit, defectsFoundInCommits, defectsPerCommit`, models ordered by items. The native API answers the same document for `stats.models` with `hours` and `roots`.
  • The model policy (`oko sessions policy run`) reads the same rating over all history whenever it decides about a session: each model a decision tried carries `measured`, the rows of the transcript models that run as that declared model (an empty list for one never measured), so a switch names how the model it chose and the ones it passed over have done. A rating it cannot read is kept on the decision as `measurementRefused` and does not stop the decision.

Refusals and safe exits#

  • `--hours takes a positive whole number of hours; got <text>: <cause>` (exit 2), for zero, a negative or a non-number.
  • `--hours <N> is more hours than a time window can span`.
  • `a done verdict carries no readable judged_at: <row>`; the shared database's own refusal when the verdicts cannot be read; the register's refusal when the defect register cannot be read.
  • A transcript that cannot be read is listed under `unreadable` with its path and cause and counts nowhere.

CLI reference#