Repository navigation
fix(mention): skip no-op tend-mention session on bot's own comments - #751
Conversation
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 |
|
@tend-agent Decision on the policy conflict you flagged: the deterministic skip is accepted here. Skipping the bot's own comments suppresses no legitimate work (unlike authorship-keyed guards on
With the before-mention ordering this fully closes #756, so add
|
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 <[email protected]>
9a42e21 to
b348cb6
Compare
|
Reworked and pushed all four:
Added |
The self-authored-comment guard is scoped to comment events; a bot self-review arrives as a pull_request_review submission, which stays on the actionable path (the prompt actions self-reviews, #762). Add a regression test that fails if the skip is ever extended to the review submission event, and state the deliberate boundary at the guard so a later "skip self-authored reviews too" edit doesn't silently break the review -> fix loop. Co-Authored-By: Claude Opus 4.8 <[email protected]>
## Summary Version bump + CHANGELOG for 0.1.11. See [CHANGELOG.md](https://github.com/max-sixty/tend/blob/release/CHANGELOG.md#0111) for the full notes. 13 commits since 0.1.10: - Adopter sandbox levers (`sandbox_path`/`sandbox_env`/`sandbox_setup`, #768) - Sandbox `PATH` derived from the runner's own `PATH` (#767) - Invited upstream contributions (#770) - `tend-mention` self-comment no-op skip (#751) - Actionable self-review handling (#762, #775) - `tend-outage` dedup self-heal (#744) - Dropped-cron-tick recovery in `list-recent-runs` (#753) - Drop self-authored attribution sign-offs (#773) - Docs fixes (#776, #771) - `claude_version` bump (#774) ## Test plan - [x] `wt test` (275 passed) - [x] `pre-commit run --all-files` (all hooks passed) - [ ] CI green on this PR > _This was written by Claude Code on behalf of Maximilian Roos_
## Summary - Regenerates tend's own `.github/workflows/tend-*.yaml` via `uvx tend@latest init` against the just-released 0.1.11. - Action pins move `0.1.10` → `0.1.11`. - `tend-mention.yaml` picks up the bot-self-comment no-op skip (#751). ## Test plan - [x] `uvx tend@latest init` ran clean, wrote 8 files - [ ] CI green on this PR > _This was written by Claude Code on behalf of Maximilian Roos_
Automated nightly regeneration of tend's workflow files, picking up the upstream release. **tend version:** 0.1.10 → 0.1.11 **Notable changes** (consumer-relevant): - Skip no-op `tend-mention` sessions triggered by the bot's own comments — a new pre-mention guard in the generated `tend-mention.yaml` short-circuits before the engagement heuristics (max-sixty/tend#751). - Respond to actionable bot self-reviews instead of exiting as a self-loop: a review the review workflow leaves on its own PR is the bot's reviewer role, so it gets actioned rather than silently skipped (max-sixty/tend#762). - Sandbox: adopter levers to reach inside the Claude-family sandbox, and derive the sandbox `PATH` from the runner's `PATH` (max-sixty/tend#768, max-sixty/tend#767). - `running-in-ci`: permit maintainer-invited upstream contributions, and prohibit self-authored attribution sign-offs (max-sixty/tend#770, max-sixty/tend#773). - Action reliability: self-heal duplicate `tend-outage` issues from concurrent leg failures, and recover dropped cron ticks in list-recent-runs via a previous-run anchor (max-sixty/tend#744, max-sixty/tend#753). Compare: max-sixty/tend@0.1.10...0.1.11 Co-authored-by: worktrunk-bot <[email protected]>
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.The same shape also fires from
pull_request_review_commentedits (subscribed foredited), which is why the guard covers that event too — closing #756.Fix
Add a guard in the
verifyscript that skips comment events authored by the bot itself:COMMENT_AUTHORis newly wired fromgithub.event.comment.user.login.Placed before the
@<bot>mention check: a bot comment that quotes a prior@-mention would re-match the mention check and escape an after-placed guard, and there is no legitimate self-summons — the bot responding to its own mention is precisely the loop this guard breaks. It covers both comment event types that take the engagement path (issue_commentandpull_request_review_comment). Thepull_request_reviewself-review paths carry intentional actionable-signal handling (the empty-body-APPROVED gate from #166/#608) and are left untouched.Policy reconciliation
Per the maintainer decision on the flagged policy conflict, the
review-reviewersskill'stend-mentionnon-issue is narrowed: a deterministic verify-gate skip of the bot's own comments is now the accepted shape (it suppresses no legitimate work), distinct from the authorship-keyed guards still rejected fortend-review(where the bot's fix-push must be re-reviewed). Thereview-runsandreviewskills don't carry an echo of that rule, so no further edits were needed there.Testing
test_mention_verify_skips_self_authored_commentsasserts the guard is generated,COMMENT_AUTHORis wired, the guard covers bothissue_commentandpull_request_review_comment, and it sits before the mention check and before the bot-authored-issue short-circuit.test_mention_self_comment_skip_spares_review_submissionspins the carve-out: the skip is scoped to comment events and must not extend to thepull_request_reviewsubmission, so a bot self-review (which the prompt actions per fix: respond to actionable bot self-reviews instead of self-loop-exiting #762) still reaches the actionable path. Guards against a later "skip self-authored reviews too" edit silently breaking the review → fix loop.pull_request_reviewboundary in-line.Closes #756