Repository navigation
Make bot failure analysis resumable and group by leaf errors - #366
Open
CodexVeritas wants to merge 2 commits into
Open
CodexVeritas wants to merge 2 commits into
CodexVeritas wants to merge 2 commits into
Conversation
- Retry GitHub requests on ConnectionError/Timeout with backoff; HTTP errors are unchanged. - Decode job logs as UTF-8 (they were decoded as latin-1, so the ❌/✅ summary lines never matched). - Cache raw logs in <output-dir>/raw_logs/ keyed by job id and reuse them on rerun. - Emit one event per failed question from its 'Error while processing question url' line, grouped by the leaf errors nested inside it. Wrapper tracebacks are only used for jobs without question-level errors. - Report per-bot failed-job and failed-question ratios. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Failed jobs per bot come from the job listing, so jobs whose log 404s still count. - Jobs of in-progress runs that have not finished are left out of the denominator. - Test analyze_runs end to end with GitHub calls stubbed. - count_by uses Counter.most_common; docstring no longer names another file's behavior. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Improves
scripts/skills/analyze_bot_failures/analyze_bot_run_failures.pyfor large windows (e.g.--since 1w --max-runs 400).Robustness
github_getretriesrequests.ConnectionError/requests.Timeoutwith 5s/15s/45s backoff, then raises. HTTP errors are unchanged (404s for jobs without logs are still logged and skipped).<output-dir>/raw_logs/run<id>_job<job id>_<bot>.log(moved out of the per-timestamp folder) and reused on rerun. Job id is in the name because re-run jobs get new ids under the same run id. Writes go through a.partialfile so an interrupted write is never reused.requestsdecoded logs as latin-1 and the❌/✅summary lines never matched. Logs are now decoded and saved as UTF-8. Logs from older analyses are not reused (different path).Grouping by root cause
Error while processing question url: '<url>': <nested message>line. The leaf errors nested in the repr'd error lists (e.g. litellmNotFoundError,BadRequestError,NumericDistributionValidationError) are extracted. The event uses the most common leaf, and the group shows the full leaf mix.❌lines set how many failures each URL had (timeout retries can repeat error lines, and subquestions of a group post share a URL). Without a summary (e.g. cancelled job), every error line counts.input_value/docs-link details, list contents, andreq_...ids. Question URLs without a trailing slash are matched.model_not_found,content_filter,empty_llm_response.Report
Running bot X with N questionsline). Failed jobs come from the job listing, so jobs whose log 404s still count; only completed jobs count toward the denominator. The report explains that the question ratio only covers failed jobs. If that line is missing, the job is left out of the ratio and a warning is logged; the script does not raise.Testing
poetry run pytest code_tests/unit_tests/test_analyze_bot_run_failures.py: 23 pass. Covers both nesting shapes, closing-quote handling, same signature at different escaping levels, retry/subquestion counting, the missing-summary case, the per-bot table, network retries, UTF-8 decoding, the cache, andanalyze_runsend to end with GitHub calls stubbed.NotFoundError×1166).🤖 Generated with Claude Code