Repository navigation
Description
This was generated by AI during triage.
From the 2026-11-11 fleet retrospective: across 245 Review run, Triage run, and Fix run Command records on 6 fleet hosts, 0/245 persisted run_metrics or session_signals in .command.json, even though their .models.json sidecars and .session.jsonl traces were already written on disk.
Agent Brief
Category: bug
Summary: CommandRecord::finish only computes and saves RunMetrics (including stage timings, UsualRange positions, review finding counts, and SessionSignals summaries) for "Run", "Spec run", and "Base fix", leaving "Review run", "Triage run", and "Fix run" with run_metrics: null.
Current behavior:
When a Review run, Triage run, or Fix run finishes, CommandRecord::finish skips RunMetrics::of(...) because self.kind is not in "Run" | "Spec run" | "Base fix". As a result:
.command.jsonstoresrun_metrics: null, omitting durabletotal_minutes, per-stagesession_signals(tokens, cost, tool errors, permission denials, repeated calls),UsualRangecomparisons, and review finding counts.thirdshift metricsweekly trends (trends::weekly) already groups rows bykind, so rows forReview run,Triage run, andFix runappear withsession_signalsand stage signals missing (or reconstructed at read time viaRunMetrics::historicalwithoutsession_signalsorreview_findings).
Unlike multi-step Custom Process Commands (#1655), Review run, Triage run, and Fix run are single-choice built-in Commands whose Command-level harness/model/effort and stage session_log paths already match Run and Base fix.
Desired behavior:
CommandRecord::finishcomputes and persistsRunMetrics::of(...)(includingSessionSignalsand any stagereview_findings) when finishing"Review run","Triage run", and"Fix run"Commands in addition to"Run","Spec run", and"Base fix".UsualRangescomputation andthirdshift show/thirdshift metricshandle persistedrun_metricson those built-in Command kinds cleanly without double-counting or alteringRun/Spec run/Base fixmetrics.- Update the user manual (
docs/guide.mdand regeneratedsite/docs/index.html) wherever it enumerates which built-in Command kinds recordRunMetrics.
Key interfaces:
CommandRecord::finishand any helper predicate identifying built-in Command kinds that persistRunMetricson completion.RunMetrics::ofandUsualRanges: verify stage timing andSessionSignalsaggregation work identically for single-sessionTriage run/Review runand multi-stageFix run(which may includeRepairandCiWatchstages).
Acceptance criteria:
- Finishing a
Review run,Triage run, orFix runwritesrun_metrics(withtotal_minutes,stages, andsession_signalspopulated from its session trace(s)) into.command.json. - A
Review runwhose review stage wrote asummary.jsonsidecar recordsreview_findingson its stage metric, and aFix runwithRepair/CiWatchstages records accuraterepairsandci_roundscounts. -
thirdshift metrics --jsonincludes observedtotal_minutesandsession_signalsfor completedReview run,Triage run, andFix runrecords. - Tests cover
CommandRecord::finishandmetricsreadback forReview run,Triage run, andFix run.
Out of scope:
- Multi-step Custom
ProcessCommands where individual steps can override harness/model (Custom process Commands record no Run metrics, and their header shows the default harness #1655). - Parent Pass/dispatcher Command kinds (
PickupPass,Experiment) that aggregate child Runs rather than executing a single Run lifecycle.
Activity
JacobStephens2 commentedon Nov 11, 2026
Implementation note discovered while researching
StageName::is_session(src/logs/command_record.rs) vstrends::weekly(src/logs/metrics/trends.rs):StageName::is_sessioncurrently omitsCodeReview("Code review", used byReview runs) as well asSecurityCloseCheckandGrading, sotrends::weeklywould skip session-levelSessionSignalsrows for"Code review"stages even afterCommandRecord::finishwritesrun_metricson"Review run". Include"Code review"(and any applicable built-in session stage kinds fromsession::Kind) inStageName::is_sessionso weekly session-stage signal rows coverReview run,Triage run, andFix runstages completely.Merge pull request #2075 from JacobStephens2/issue-2047