hourly-review: bot-created issues trigger claude-mention, causing duplicate fix PRs
Problem
When the hourly review workflow creates an issue that incidentally mentions @worktrunk-bot in its body text, the claude-mention workflow triggers on the issues event and duplicates the hourly review's work — including creating a second fix PR for the same problem.
Evidence
Run 22917013836 (hourly review, 18:03 UTC):
- Created issue #1424 describing a CI regression
- Created PR #1425 on branch
hourly/fix-fork-review-comment-secretsto fix it
Run 22917265227 (claude-mention, 18:09 UTC):
- Triggered by issue #1424's creation (body contains
@worktrunk-botin the sentence "comment contained@worktrunk-bot") - Read the issue, investigated the same files, created PR #1426 on branch
fix/issue-1424— a duplicate fix
Both PRs modify the same two files (.github/CLAUDE.md, .github/workflows/claude-mention.yaml) with overlapping but slightly different changes. PR #1426 adds a more detailed fork-secret reference table, while PR #1425 has a more concise fix.
Root cause
Two independent problems combine:
-
Hourly review issues mention
@worktrunk-botincidentally — issue #1424 quotes the bot's name in a description of CI behavior, not as a request for action. Theclaude-mentionworkflow'sissuestrigger usescontains(github.event.issue.body, '@worktrunk-bot'), which matches any mention regardless of context. -
claude-mentiondoesn't check for existing fix PRs — the mention run checked for duplicate issues and branches namedfix/issue-*orrepro/issue-*, but missed PR #1425 on branchhourly/fix-fork-review-comment-secrets. It didn't rungh pr listto check for open PRs targeting the same issue.
Suggested fix
Option A: Have the hourly review workflow use backtick-escaped mentions (`@worktrunk-bot`) in issue bodies so they don't trigger claude-mention. This is the simplest fix.
Option B: Add a worktrunk-bot author check to the claude-mention issues trigger — skip issues authored by the bot itself (similar to the existing comment.user.login != 'worktrunk-bot' check for comments).
Option C: Both — escape mentions in hourly review output AND add the author filter as defense-in-depth.
Immediate action needed
One of PR #1425 or #1426 should be closed as a duplicate. PR #1426 has more thorough documentation changes (fork-secret reference table), but both fix the core workflow issue identically.
Thanks for the detailed write-up! I investigated and confirmed the duplicate trigger chain described here.
PR #1429 implements Option B — adding github.event.issue.user.login != 'worktrunk-bot' to the issues trigger in claude-mention.yaml, consistent with the existing loop-prevention checks on issue_comment and pull_request_review_comment events. It also documents the new filter in .github/CLAUDE.md.
CI is currently running on that PR. I'll leave it to a maintainer to decide whether Option A (escaping mentions in hourly review output) is also worth adding for defense-in-depth, and which of PR #1425 / #1426 to close as the duplicate for #1424.