worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

triage-issue: bot ignores pre-merge failure, commits unformatted code

Open worktrunk-bot opened this issue 8 months ago • 5 comments

Problem

The triage bot in run 22795714447 committed code with formatting errors because it ignored a failing pre-merge check. The pre-merge hook failed with:

◎ Running pre-merge project:pre-commit
  pre-commit run --all-files
sh: 1: pre-commit: not found
✗ pre-merge command failed: pre-commit: exit status: 127

The bot saw this output but proceeded to commit anyway, resulting in a CI lint failure and requiring a second cargo fmt commit on PR #1331.

Root cause

Two factors:

  1. pre-commit is not installed in the claude-issue-triage CI environment. The triage skill tells the bot to run cargo run -- hook pre-merge --yes, but that depends on pre-commit being available.

  2. The bot ignored the visible failure. Even though the output clearly showed ✗ pre-merge command failed, the bot piped through | tail -30 (hiding the exit code) and did not react to the error text in the output.

Additional: stale gh run watch reference

The triage-issue skill still references gh run watch on line 136, which was flagged in #1316 but not actually fixed before that issue was closed. The bot correctly followed the running-in-ci skill's poll loop instead, but the inconsistency remains.

Suggested fix

Update the triage-issue skill step 6 to:

  1. Add cargo fmt as a fallback lint check when pre-merge fails (since pre-commit may not be installed)
  2. Replace gh run watch with the poll approach from running-in-ci

worktrunk-bot avatar Mar 07 '26 09:03 worktrunk-bot

did this have a PR attached?

max-sixty avatar Mar 07 '26 20:03 max-sixty

@worktrunk-bot did this have a PR attached?

max-sixty avatar Mar 08 '26 03:03 max-sixty

Yes — #1333 was created to address both issues raised here (installing pre-commit in the claude-setup action and replacing the stale gh run watch reference). It has already been merged.

worktrunk-bot avatar Mar 08 '26 03:03 worktrunk-bot

ok, diagnose why we didn't initially get a response to this and create a PR fixing it

max-sixty avatar Mar 08 '26 03:03 max-sixty

Diagnosed the issue and opened #1352 to fix it.

Root cause: The verify-engagement step for plain issues only checked whether the bot had commented — it didn't check issue authorship. Since I opened #1332 but hadn't commented on it yet, the verify step found zero bot comments and skipped the entire job.

For PRs, there's an equivalent author check (PR_AUTHOR == worktrunk-bot), but the plain-issue branch was missing it.

Run 22806824478 confirms: the verify step ran, all subsequent steps (checkout, Claude) were skipped.

The fix adds the same author check for issues that already exists for PRs.

worktrunk-bot avatar Mar 08 '26 03:03 worktrunk-bot