Skip to content

Reliability: retried failures count, usage writes outlast races, edit_file reads stringified edits - #619

Merged
nambok merged 1 commit into
mainfrom
reliability-tab-counts
Nov 11, 2026
Merged

nambok merged 1 commit into
mainfrom
reliability-tab-counts

Conversation

@nambok

@nambok nambok commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Reading a self-hosted install's recent runs and logs showed three things CoderHelm got wrong:

  • The Reliability tab hid most failures. A failed run that a person retries (or starts over) becomes retried, and the tab, the Failed runs tile, the failure rate and the daily and per-repository counts read failed only. The tab showed far fewer failures than had happened, and "No failed runs" for a week that had some. Runs that stopped for a person (more of them than failures) didn't show at all.
  • Usage writes lost races. Every model call adds to the same day, month and year counters in one transaction, so calls made side by side cancel each other (TransactionConflict). Three retries at fixed waits met again: many calls a day were queued to be added later, and each replay failed its queue message once before it was counted.
  • edit_file refused stringified edits. The model sometimes sends edits as a JSON string. The call failed "Missing edits array" (again and again) and the turn was lost.

Changes

  • gateway/src/routes/analytics.rs
    • RunRow::failed(): failed, or retried with failed_pass recorded (only common::run_fail writes it, so answered questions and other retries are not counted). Used by the summary, daily and per-repository counts, the failure groups and Recently failed. New summary.failed_then_retried.
    • Failure groups carry stage (the step most of their runs failed in) and retried; groups past the first eight are summed in failures_more instead of dropped.
    • waiting: runs that stopped for a person and still wait, grouped by what for (the recorded wait's action or questions); a wait that names nothing is counted as "Nothing recorded".
    • failure_reason: a list of quoted names is one placeholder, a hex id (a commit hash) is one number instead of #e#b, and 160 characters are kept, so the same failure on other files or commits is one group and its cause at the end of the sentence survives.
  • common/src/usage.rs: six jittered retries (50 ms to 2.4 s, each spread over half to one and a half times) for a counter write; replay retries the same way before it fails the message.
  • worker/src/passes/implement.rs, feedback.rs: tool_edits reads edits sent as a string holding an array; any other shape gets an answer that says what to send.

Verification

  • cargo test -p gateway --bin gateway analytics: 49 passed, including new tests that fail on the old code:
    • a_failure_a_person_retried_is_still_a_failure (old: 1 failed run counted, not 2; no retried count),
    • one_failure_on_other_files_and_commits_is_one_reason (old: two groups, hashes read #e#b, the cause cut off),
    • failure_groups_past_the_shown_ones_are_summed, waiting_runs_group_by_what_they_wait_for, a_wait_is_read_from_its_record (old: no such fields).
  • cargo test -p common usage::: 26 passed, including a_call_that_loses_four_races_is_still_counted_now (old: three retries, the call goes to the fallback queue) and a_replay_that_loses_a_race_is_tried_again (old: the first conflict fails the replay).
  • worker tests tool_edits_tests (old: a stringified array fails "Missing edits array").
  • cargo fmt --check.

…ast races, edit_file reads stringified edits

Analytics: a failed run a person retries (or starts over) becomes
`retried`, and the Reliability tab, the Failed runs tile, the failure rate,
the daily and per-repository counts all read `failed` only. On one install
the last 30 days showed 6 failures where 16 runs had failed, and the last 7
days showed none where 3 had. A run is failed when it is `failed`, or
`retried` with the pass it failed in recorded (only `run_fail` writes
that). Failure groups now carry the step most of their runs failed in and
how many a person retried, the groups past the first eight are summed in
`failures_more` instead of dropped, and runs waiting on a person are
grouped by what they wait for (`waiting`), with waits that name nothing
counted apart. Reasons group across file lists and commit hashes ("…, …"
is one placeholder; a hex id is one number, not "#e#b") and keep 160
characters so the cause at the end survives.

Usage meter: every call adds to the same day, month and year items in one
transaction, so calls made side by side cancel each other with
TransactionConflict. Three retries at fixed waits met again: 399 calls in
one day were queued for later, and their replays failed the queue message
once each. Writes now retry six times with jittered waits, and a replay
retries the same way before it fails the message.

edit_file: the model sometimes sends `edits` as a JSON string. The call
failed "Missing edits array" (16 times in nine days) and read as if
nothing was sent. A string holding an array is read as that array; any
other shape gets an answer that says what to send.
@nambok nambok closed this Nov 11, 2026
@nambok nambok reopened this Nov 11, 2026
@nambok
nambok merged commit fea0d77 into main Nov 11, 2026
10 checks passed
@nambok
nambok deleted the reliability-tab-counts branch November 11, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant