Skip to content

Record RunMetrics and SessionSignals on Review run, Triage run, and Fix run Command records #2047

Closed

Description

@JacobStephens2

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.json stores run_metrics: null, omitting durable total_minutes, per-stage session_signals (tokens, cost, tool errors, permission denials, repeated calls), UsualRange comparisons, and review finding counts.
  • thirdshift metrics weekly trends (trends::weekly) already groups rows by kind, so rows for Review run, Triage run, and Fix run appear with session_signals and stage signals missing (or reconstructed at read time via RunMetrics::historical without session_signals or review_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::finish computes and persists RunMetrics::of(...) (including SessionSignals and any stage review_findings) when finishing "Review run", "Triage run", and "Fix run" Commands in addition to "Run", "Spec run", and "Base fix".
  • UsualRanges computation and thirdshift show / thirdshift metrics handle persisted run_metrics on those built-in Command kinds cleanly without double-counting or altering Run / Spec run / Base fix metrics.
  • Update the user manual (docs/guide.md and regenerated site/docs/index.html) wherever it enumerates which built-in Command kinds record RunMetrics.

Key interfaces:

  • CommandRecord::finish and any helper predicate identifying built-in Command kinds that persist RunMetrics on completion.
  • RunMetrics::of and UsualRanges: verify stage timing and SessionSignals aggregation work identically for single-session Triage run / Review run and multi-stage Fix run (which may include Repair and CiWatch stages).

Acceptance criteria:

  • Finishing a Review run, Triage run, or Fix run writes run_metrics (with total_minutes, stages, and session_signals populated from its session trace(s)) into .command.json.
  • A Review run whose review stage wrote a summary.json sidecar records review_findings on its stage metric, and a Fix run with Repair / CiWatch stages records accurate repairs and ci_rounds counts.
  • thirdshift metrics --json includes observed total_minutes and session_signals for completed Review run, Triage run, and Fix run records.
  • Tests cover CommandRecord::finish and metrics readback for Review run, Triage run, and Fix run.

Out of scope:

Activity

  1. added
    bug
    ready-for-agent
    on Nov 11, 2026
  2. JacobStephens2 commented on Nov 11, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Implementation note discovered while researching StageName::is_session (src/logs/command_record.rs) vs trends::weekly (src/logs/metrics/trends.rs):

    StageName::is_session currently omits CodeReview ("Code review", used by Review runs) as well as SecurityCloseCheck and Grading, so trends::weekly would skip session-level SessionSignals rows for "Code review" stages even after CommandRecord::finish writes run_metrics on "Review run". Include "Code review" (and any applicable built-in session stage kinds from session::Kind) in StageName::is_session so weekly session-stage signal rows cover Review run, Triage run, and Fix run stages completely.

  3. added
    in-progress
    and removed
    ready-for-agent
    on Nov 12, 2026
  4. added a commit that references this issue on Nov 12, 2026
  5. removed
    in-progress
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions