Repository navigation
fix(review-pr): add CI failure verification and duplicate comment guard - #1385
worktrunk-bot wants to merge 1 commit into
Conversation
Addresses two behavioral issues observed in the past hour: 1. Bot posted identical CI failure comments twice on PR #1381 during the dismiss-and-recomment flow (reviews 7 seconds apart). Adds a duplicate check before posting CI failure comments, similar to the existing guard for initial reviews. 2. Bot asserted pre-commit.ci failure was "transient infrastructure" on PR #1381 without checking main branch CI history (recurrence of #1335 despite fix in #1337). Adds explicit verification step with gh api command directly in the CI failure handling section. Closes #1383 Closes #1384 Co-Authored-By: Claude Opus 4.6 <[email protected]>
| first** — if the session times out before dismissing, a stale approval | ||
| (contradicted by red CI) is better than a bare dismissal with no context. | ||
| 2. Dismiss the bot's approval if one exists. Use a short dismiss message | ||
| - **A check failed** → investigate before characterizing. **Never call a |
There was a problem hiding this comment.
can you check whether we have this already somewhere? I thought I remembered this being somewhere
There was a problem hiding this comment.
Yes — the running-in-ci skill already has this under "Thoroughness — Grounded Analysis":
Never claim a CI failure is "pre-existing" or "unrelated" without evidence. Before characterizing any failure this way, check main branch CI history (e.g.,
gh api "repos/{owner}/{repo}/actions/runs?branch=main&status=completed&per_page=5") ...
Since running-in-ci is always loaded in CI sessions (where review-pr runs), duplicating it here is redundant. I can drop the CI verification block from this PR and keep only the duplicate-comment guard, or drop the whole PR if you think the existing coverage is sufficient.
There was a problem hiding this comment.
look through the failure cases — was that loaded? diagnose the problem please
There was a problem hiding this comment.
Good question. The CI logs hide the actual conversation (full output hidden for security), so I can't directly confirm from the logs of run 22831994262 or run 22832096573. But I can diagnose from the skill structure:
The review-pr skill references /running-in-ci but never loads it. Line 362 says "monitor CI using the poll approach from /running-in-ci" — that's a prose reference, not a skill invocation. The bot receives the review-pr skill as its primary prompt and follows its Step 1–6 workflow. It has no instruction within the review-pr skill to actually invoke /running-in-ci as a separate skill call.
The system prompt does say "Use /running-in-ci before starting work" — but in practice the bot's first action is /review-pr, which gives it a self-contained workflow. It likely never separately invokes /running-in-ci because review-pr already covers the full review lifecycle.
So the grounded-analysis rule ("Never claim a CI failure is pre-existing or unrelated without evidence") existed in running-in-ci but was almost certainly never loaded into context during these review sessions. That's why #1337's fix didn't prevent the recurrence in #1384.
This PR's approach — duplicating the CI verification guidance directly into review-pr's Step 5 — addresses the root cause (the guidance needs to be in the skill that's actually loaded). An alternative would be to add an explicit "invoke /running-in-ci" instruction in review-pr's Step 5, but that risks context bloat from loading the full skill when only the CI verification rule is needed.
There was a problem hiding this comment.
(for any future travellers, this is not accurate)
will resolve locally, ty
Summary
gh apicheck of main branch CI before characterizing any failure as "transient" or "unrelated" (recurrence of claude-mention: bot speculates CI failure is pre-existing without verifying against main #1335 despite fix in fix(skill): require evidence before claiming CI failures are pre-existing #1337)Closes #1383
Closes #1384
Test plan
🤖 Generated with Claude Code