Skip to content

fix: filter bot self-triggers in tend-mention workflow - #203

Closed
tend-agent wants to merge 2 commits into
mainfrom
hourly/review-24167255674
Closed

tend-agent wants to merge 2 commits into
mainfrom
hourly/review-24167255674

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Summary

  • The tend-mention workflow's if condition let all pull_request_review and pull_request_review_comment events through without checking the sender. When the bot approves or comments on a PR, its own action triggers tend-mention, which invokes Claude only to discover the event was self-triggered and exit silently — wasting CI minutes and API calls.
  • Adds sender filtering for these event types (github.event.comment.user.login / github.event.review.user.login), matching the existing pattern used for issue_comment events.

Evidence

3 self-triggered runs in a single hour on max-sixty/tend, all exiting silently after detecting the bot's own review/comment:

Run Event Trigger
24166293960 pull_request_review on PR #200 Bot's own APPROVED review
24165971136 pull_request_review on PR #199 Bot's own APPROVED review
24165889293 pull_request_review_comment on PR #198 Bot's own inline suggestion

Classification: Structural — every bot approval/review comment deterministically fires these events. Gate assessment: High confidence (3 occurrences, structural), targeted fix → passes both gates.

Test plan

  • Full test suite passes (147/147)
  • Regtest snapshots updated for both mention workflow variants

🤖 Generated with Claude Code

The tend-mention workflow's `if` condition allowed all `pull_request_review`
and `pull_request_review_comment` events through without checking the sender.
When the bot approves or comments on a PR, its own action triggers tend-mention,
which invokes Claude only to discover the event was self-triggered and exit
silently — wasting CI minutes and API calls.

Add sender filtering for these event types, matching the existing pattern used
for `issue_comment` events (`github.event.comment.user.login != bot_name`).

Evidence: 3 self-triggered runs in a single hour on max-sixty/tend
(runs 24166293960, 24165971136, 24165889293), all exiting silently after
detecting the bot's own review/comment.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@tend-agent tend-agent added the claude-behavior Behavioral issues found by review-reviewers label Apr 9, 2026
@max-sixty max-sixty closed this Apr 9, 2026
tend-agent pushed a commit that referenced this pull request Apr 14, 2026
…as non-issue

Add `tend-mention` self-triggers from bot-authored comments to the non-issues
list. Multiple review-reviewers runs have observed this pattern (bot posts a
comment → `issue_comment` event fires `tend-mention` → Claude exits silently
via the self-conversation guard) and one prior PR (#203) attempted sender-
based filtering, which the maintainer closed without merge — same authorship-
keyed-guard pattern rejected in #154 and #212. Recording this explicitly
prevents future runs from re-drafting similar PRs.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
max-sixty pushed a commit that referenced this pull request Apr 14, 2026
## Summary

Add a second entry to the `review-reviewers` **Non-issues** list so
future
hourly runs don't re-draft sender-based filters for `tend-mention`. The
entry
covers the case where the bot's own `issue_comment` (e.g., posting on a
user
issue where it previously replied, or its own tracking issue) fires
`tend-mention`, which then exits silently via the prompt's
self-conversation
guard.

## Evidence

Three self-trigger runs on `max-sixty/tend` in the past ~2 hours (window
15:18Z–16:17Z on 2026-04-14), each spun up Claude and exited silently:

| Run | Trigger | Cost | Turns |
|---|---|---|---|
|
[24407340908](https://github.com/max-sixty/tend/actions/runs/24407340908)
| `tend-agent` comment on `review-reviewers-tracking` #133 | $0.47 | 12
|
|
[24409523729](https://github.com/max-sixty/tend/actions/runs/24409523729)
| `tend-agent` triage comment on issue #269 | $0.20 | 6 |
|
[24410231240](https://github.com/max-sixty/tend/actions/runs/24410231240)
| `tend-agent` comment on tracking issue #133 | $0.22 | 7 |

All three exit with reasoning like "self-trigger, no role boundary,
exiting
silently" — the prompt-level guard works correctly, just at a few
hundred
tokens of cost per occurrence.

## Why no workflow fix

[#203](#203) ("fix: filter bot
self-triggers in tend-mention workflow") proposed exactly this sender
filter
for `pull_request_review` / `pull_request_review_comment` events on
2026-04-09. @max-sixty closed it without merge or comment, matching the
pattern of earlier closures of authorship-keyed guards
([#154](#154),
[#212](#212)) already called out
in the
non-issues list. Extending the same sender filter to `issue_comment`
would
fit the same rejected shape, so this PR only updates the skill to
prevent
future runs from re-drafting it.

## Gate assessment

- **Evidence level**: High — 3 occurrences this run, structural (every
bot
comment on a participated-in issue fires `tend-mention` verify→handle),
and
  direct prior-art signal (#203 closed by maintainer).
- **Classification**: Structural (deterministic from workflow logic) —
same
  condition always produces the wasted Claude invocation.
- **Change type**: Targeted simplification — adds one bullet to an
existing
  warning list. No workflow or generator changes.
- **Passes both gates**: yes (structural 1+ occurrence sufficient for
  removal/simplification; change is one-paragraph docs).

## Test plan

- [ ] Rendered non-issues list reads sensibly and cites #203 / #268
accurately

Co-authored-by: continuous-bot <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
tend-agent added a commit that referenced this pull request May 10, 2026
Remove links to specific past PRs (#154, #212, #263, #203, #268, #392, #375, #305, #318) from review-reviewers and running-in-ci, restating each as a structural rule (what shape is accepted, what shape is not). Extend "Authoring skills" in the root CLAUDE.md with a parallel "No specific past-case references" bullet so future skill edits don't re-introduce them.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-behavior Behavioral issues found by review-reviewers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants