fix(mention): skip no-op tend-mention session on bot's own comments#751
fix(mention): skip no-op tend-mention session on bot's own comments#751tend-agent wants to merge 1 commit into
Conversation
The verify gate's bot-comment guard (#608) only catches GitHub App / Bot accounts via comment.user.type == "Bot". Tend's bot is a PAT-based User account, so its own comments fall through to the engagement heuristics and spin up a handle session that exits silently — pure waste. This recurs on the monthly tracking-issue rollover, where review-reviewers posts evidence-gist links on its own tracking issue. Add a guard skipping self-authored issue_comment events, wired from github.event.comment.user.login. Scoped to issue_comment so the pull_request_review self-review paths keep their intentional actionable-signal handling. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tend-agent
left a comment
There was a problem hiding this comment.
One scope gap worth a note (self-review): the guard fires only on issue_comment, but pull_request_review_comment (subscribed here for edited only) is the other event that carries github.event.comment.*, and a bot's own edited inline comment on a PR where it already has engagement takes the same generic-heuristic path (lines 166–181) into a no-op handle session. COMMENT_AUTHOR is already populated for that event, and the @-mention check on line 80 runs first, so a self-summons stays honored — extending the condition to [ "$EVENT_NAME" = "issue_comment" ] || [ "$EVENT_NAME" = "pull_request_review_comment" ] closes it for free.
Frequency is near-zero (the bot rarely edits its own inline comments, and created isn't subscribed), so this isn't a blocker — but the PR body groups this path under the "pull_request_review self-review paths [that] carry intentional actionable-signal handling," which isn't quite accurate: pull_request_review_comment has no such handling, it just falls through to the engagement heuristics. Worth either extending the guard or documenting the deliberate exclusion.
|
Flagging a standing-guidance conflict for a maintainer to reconcile before this lands — not a blocker. This PR's guard keys on comment authorship ( Worth a maintainer decision because there's a real tension the reviewing bots didn't surface: the The reconciliation both ways
Either way it's a maintainer call: relax/scope the non-issue to bless this optimization, or land a label-based skip and add the ruling to the Surfaced by the hourly |
Problem
tend-mention'sverifygate has no self-loop guard for the bot's own comments. The existing bot-comment guard added in #608 only catches GitHub App / Bot accounts (github.event.comment.user.type == "Bot"); tend's bot is a PAT-based User account, so its own comments fall through to the engagement heuristics — either the bot-authored-issue short-circuit (ISSUE_AUTHOR == bot) or "bot has prior comments" — and reach thehandlejob, which then exits silently via the prompt's self-loop guard. A full agent session is spun up for nothing.#608 explicitly noted this gap and left it: "Tend's own bot accounts are PAT-based user accounts (
user.type == "User"), so this does not affect tend-on-tend behavior." The skill-level guard catches it, but only after paying for the session.Evidence
Observed every
review-runswindow and recorded in the June tracking issue (#646). The clearest recurring trigger is the monthly tracking-issue rollover:review-reviewerscreates its month's tracking issue and posts one evidence-gist link comment per repo on it, each firing a self-looptend-mentionrun.Most recent occurrence — 2026-07-01, tracking issue #750:
Prior windows recorded the same shape (bot's duplicate-tracking notices and tracking-thread comments spinning up no-op handle sessions — #646 findings for runs 26810096874, 26941951090).
Fix
Add a guard in the
verifyscript, right after the App-bot check, that skipsissue_commentevents authored by the bot itself:COMMENT_AUTHORis newly wired fromgithub.event.comment.user.login.Ordering matches #608: it runs after the
@<bot>mention check (a hypothetical self-summons is still honored) and before the bot-authored-issue / prior-engagement short-circuits that produce the no-op session. Scoped toissue_commentonly — thepull_request_reviewself-review paths carry intentional actionable-signal handling (the empty-approval guard from #166/#608) and are left untouched.Testing
test_mention_verify_skips_self_authored_commentsasserts the guard is generated,COMMENT_AUTHORis wired, and the guard sits between the mention check and the bot-authored-issue short-circuit.mentionregression snapshots.