Skip to content

fix(ci): skip claude-mention for bot-authored issues - #1429

Merged
max-sixty merged 1 commit into
mainfrom
hourly/fix-self-trigger-1428
Mar 10, 2026
Merged

max-sixty merged 1 commit into
mainfrom
hourly/fix-self-trigger-1428

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Summary

  • Add github.event.issue.user.login != 'worktrunk-bot' to the issues trigger in claude-mention.yaml
  • Document the new filter in .github/CLAUDE.md "Does not trigger" list

Problem

The hourly review workflow creates issues (like #1424) that incidentally mention @worktrunk-bot in body text — e.g., "comment contained @worktrunk-bot". This triggers claude-mention on the issues event, which then duplicates the hourly review's work, including creating a second fix PR (#1425 vs #1426 for the same issue).

Fix

Add an author check to skip issues created by worktrunk-bot itself, consistent with the existing comment.user.login != 'worktrunk-bot' loop-prevention checks on issue_comment and pull_request_review_comment events.

Closes #1428

Test plan

  • Verify the if: condition syntax is valid (CI should pass)
  • Confirm the next hourly review run doesn't trigger a claude-mention run on its issues

🤖 Generated with Claude Code

The hourly review workflow creates issues that incidentally mention
@worktrunk-bot in body text (e.g., describing CI behavior). This
triggers claude-mention on the issues event, which then duplicates
the hourly review's fix work — including creating a second PR.

Add an author check (github.event.issue.user.login != 'worktrunk-bot')
to the issues trigger, consistent with the existing loop-prevention
checks on comment events.

Closes #1428

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@max-sixty
max-sixty merged commit 66e8c27 into main Mar 10, 2026
20 checks passed
@max-sixty
max-sixty deleted the hourly/fix-self-trigger-1428 branch March 10, 2026 19:57
max-sixty pushed a commit that referenced this pull request Mar 11, 2026
## Summary

- Narrows the self-authored PR early-exit: skip only review posting
(step 4) and thread resolution (step 6), but keep CI monitoring (step 5)
- Removes the "done, stop here" instruction from step 5 that previously
told the model to skip CI monitoring for silent self-authored PRs

## Context

Run
[22920083221](https://github.com/max-sixty/worktrunk/actions/runs/22920083221)
spent ~9 minutes polling CI after correctly staying silent on
self-authored PR #1429. The original fix skipped steps 4–6 entirely, but
[review
feedback](#1431 (comment))
correctly noted that CI monitoring is valuable for self-authored PRs —
the bot can self-fix failures via step 7.

Closes #1430

## Test plan

- [x] Verify the instruction reads naturally in context
- [ ] Monitor next self-authored PR review to confirm the model monitors
CI but skips posting

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: worktrunk-bot <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
max-sixty pushed a commit that referenced this pull request Mar 21, 2026
…ixes (#1548)

## Problem

When a user both comments on an existing issue AND files a new issue
within seconds (as happened with #1279/#1543), two independent workflows
(`claude-mention` and `claude-issue-triage`) race to create fix PRs.
This produced duplicate PRs #1544 and #1545, which modify the exact same
6 files with nearly identical changes.

The review bot then reviewed both PRs independently and even posted
misleading feedback on #1545 — flagging "missing" call site migrations
in `src/llm.rs` and `src/commands/step_commands.rs` that PR #1544
already handles.

**Evidence:** Run 23121388888 (review of #1545) posted a COMMENT
suggesting files that the sibling PR #1544 already covers. Run
23121179226 (review of #1544) found no issues but didn't detect the
duplication either.

This is a variant of #1428 but affects user-triggered events (not
bot-authored), so the existing bot-author filter from #1429 doesn't
help.

## Fix

Add a new **Step 2: Check for overlapping PRs** to the review-pr skill.
Before reading the diff, the reviewer checks whether other open
bot-authored PRs touch the same files. If overlap is found, it's flagged
in the review so one can be closed as a duplicate.

Also renumbers subsequent steps (3→4, 4→5, etc.) and updates internal
cross-references.

## Why this approach

- **Catches duplicates at review time** — the cheapest point to detect,
since both PRs exist by then
- **Doesn't require workflow coordination** — no locking or
inter-workflow communication needed
- **Low false-positive risk** — overlapping files on bot PRs with
similar fixes is a strong signal

The underlying race between triage and mention workflows remains (fixing
that would require cross-workflow locking), but this ensures the
reviewer surfaces the duplication for human action.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: worktrunk-bot <[email protected]>
Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hourly-review: bot-created issues trigger claude-mention, causing duplicate fix PRs

2 participants