Repository navigation
Reliability: retried failures count, usage writes outlast races, edit_file reads stringified edits - #619
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reading a self-hosted install's recent runs and logs showed three things CoderHelm got wrong:
retried, and the tab, the Failed runs tile, the failure rate and the daily and per-repository counts readfailedonly. 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.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.editsas a JSON string. The call failed "Missing edits array" (again and again) and the turn was lost.Changes
gateway/src/routes/analytics.rsRunRow::failed():failed, orretriedwithfailed_passrecorded (onlycommon::run_failwrites 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. Newsummary.failed_then_retried.stage(the step most of their runs failed in) andretried; groups past the first eight are summed infailures_moreinstead 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;replayretries the same way before it fails the message.worker/src/passes/implement.rs,feedback.rs:tool_editsreadseditssent 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, includinga_call_that_loses_four_races_is_still_counted_now(old: three retries, the call goes to the fallback queue) anda_replay_that_loses_a_race_is_tried_again(old: the first conflict fails the replay).workerteststool_edits_tests(old: a stringified array fails "Missing edits array").cargo fmt --check.