Repository navigation
fix(triage): say why, where and which log in BOT_FAILED comments - #5430
Merged
Merged
Conversation
The issue-side failure comments only said "see the triage bot's logs", and the PR-side ones did so for any failure without a hand-written reason. The logs live on the bot's host, so nobody else could tell a spent turn budget from a crashed run. Each of the four failure comments now carries: - Reason: a classified cause - out of turns, spend limit, credit or usage limit, expired login, rate limit, overloaded API, network loss, a signal, a failed gh/git subcommand, else the exit status. The log is only classified, never quoted, and only its last few thousand characters of the final attempt are searched. - Failed at: file, line and function in triage_daemon.py where the failure arose, with the daemon's short commit. - Log: the log file's name, not its path. The claude runs raise FlowFailed, a CalledProcessError that carries the log path, so the cause can be read from the run that failed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Posted by Claude on behalf of @chalfontchubby.
In short
When the triage bot gives up and adds
BOT_FAILED, the comment now says why it failed, where in the daemon it failed, and which log file to open. Before, the issue-side comments only said "see the triage bot's logs", and those logs live on the bot's host, so nobody else could tell a spent turn budget from a crash.What a failure comment now carries
All four paths (first-pass triage, issue follow-up, PR review, PR cleanup):
gh/gitsubcommand (leading words only, never the arguments, since a comment body can be one), or the exit status.triage_daemon.py:<line> in <function>()plus the daemon's short commit, so the line can be read against the right file. It is the innermost frame in this file, not thesubprocessmodule's frame beneath acheck=True. For a run that exited 0 and did nothing there is no traceback, so it names theprocess_*function that noticed.The log is only classified, never quoted, because it can hold a reporter's attachment or a token.
How
FlowFailedis aCalledProcessErrorthat also carries the log path.triage(),triage_followup(),review_pr()andcleanup_pr()raise it, so the cause can be read from the run that failed.FAILURE_LOG_SIGNATURESis matched only against the last 4000 characters after the finalstartedmarker. The log is appended to across retries, and the agent quotes the issue it is reading, so an issue about "Reached max turns" must not classify its own triage.mark_*_failed()functions takeexc=, and the callers pass the exception they caught.Known limits
FAILURE_LOG_SIGNATURESare from memory and have not been checked against a real failed log. A wrong or stale entry gives the less specific exit-status message, never a wrong label. Worth checking against a real file in~/predbat-triage-bot/logs/.Testing
gharguments not leaking, the origin frame for both aFlowFailedand acheck=Truefailure, the clean-exit origin, and all four comments.coverage/run_pre_commitpasses.🤖 Generated with Claude Code