Repository navigation
mention: skip issue_comment.edited retrigger on commenter self-edit - #574
tend-agent wants to merge 1 commit into
Conversation
When a commenter edits their own issue_comment within 2 minutes of posting without adding an @-mention, treat the original `created` event as the canonical trigger and skip the `edited` retrigger before the agent runs. The full handle job currently runs end-to-end on both events; the second silent-exits via recheck-before-posting dedup, paying a few minutes of agent wall-time per occurrence. The filter is narrow: edit-to-summon, maintainer edits of the bot's comments, and stale edits days later all still run. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
but if there's an edit, don't we want to handle that like a new comment and check whether it's relevant? |
|
You're right — an edit can change relevance, and this filter would drop the case where the Empirically all 6 observed cases were typo-class refinements (no relevance change), but that's not structural proof — it could just reflect that the sample doesn't contain a relevance-changing edit. The savings (~2 min × 6 occurrences over 2 months) are modest against that structural risk. If you want to close in favor of the existing dedup-recheck silent-exit being the correct cost, I'll update the |
|
yes please |
|
Closing per the decision above — the dedup-recheck silent-exit is the correct cost, since an edit can change relevance and a skipped retrigger has no recovery path. Follow-up PR updates the |
Summary
Skip the duplicate
tend-mentionagent run when a commenter edits their ownissue_commentwithin ~2 minutes of posting and the edit did not add an@<bot>-mention. The originalcreatedevent is the canonical trigger; theeditedretrigger currently fires a second handle job that does the agent's full context-load and then exits silently via the recheck-before-posting dedup, paying ~2–7 min of agent wall-time per occurrence.Why this shape, why now
This is the 6th cumulative occurrence of the human-comment-edit retrigger pattern (April: 4, May: 2). The 6th was logged in this run: Oxygen66 (
author_association: NONE) created issue #2856 comment 4508170976 at 12:16:12Z and edited it at 12:16:53Z (41s later, no@worktrunk-botadded). Bothtend-mentionruns (26225338575, 26225369828) reached the same handle job; the second ran ~1.7min of agent time and silent-exited. The accumulated evidence and 6th-occurrence action threshold were set by prior review-reviewers runs — see the evidence gist and run 25313817498's verdict (the 5-condition filter sketched there is what this PR implements).Filter shape
Skip when all five conditions hold (none alone is sufficient):
event_name == issue_commentaction == editedsender.login == comment.user.login(commenter is editing their own comment, not a maintainer editing the bot's comment)comment.updated_at - comment.created_at < 120s(refinement window, not a stale edit days later)comment.bodydoes not contain@<bot>(already exits true above on @-mention, so this is implicit and is the reason the new block sits after the @-mention check)What this does NOT affect
@<bot>added to an existing comment): exits true at the prior @-mention check before this filter runs.sender != comment.user.login, so the filter does not skip — the agent runs.pull_request_review_commentevents: this filter only applies toissue_commentevents. The PR review-comment subscription is alreadytypes: [edited]-only, so there is nocreated-vs-editedduplication on that surface.review-runsPATCHing a month-long tracking comment): the edit is far outside the 120s window, so the filter does not skip — the existing self-conversation-guard silent-exit pattern still handles it.Relation to the documented non-issue rule
The
review-reviewersskill's non-issue list states that "sender-based or commenter-based filters ontend-mentionare not the accepted shape" — the rationale is PR #154/#203/#212, which all gated on the bot's own authorship. This filter is structurally different: it gates on the editor matching the comment's author (human or otherwise), without referencing the bot's identity. If the maintainer judges that the rule's letter still covers this shape, closing this PR without merge would be useful signal — we'd then tighten the non-issue paragraph to call out commenter-self-edit filters explicitly and downgrade the cumulative counter to record-only-permanent.Test plan
uv run --project generator pytest generator/tests/— 97 passeduvx pre-commit run --files generator/src/tend/templates/mention.yaml.j2— cleanactionlintfinds no issuestrue) and the bot-engagement check, so all three documented case shapes route correctlyEvidence accumulated across runs: evidence gist. Tracking issue: review-reviewers-tracking: 2026-05.