Repository navigation
fix(mention): skip no-op sessions for undirected bot comments - #608
Conversation
Undirected bot comments (deploy notifications, CI status) on bot-authored PRs were falling through to the PR-author short-circuit in `verify`, which fired a full agent session per comment. Since deploy bots edit their comment to update status and we subscribe to both `created` and `edited`, each notification produced two no-op sessions. Add a guard between the @-mention check and the PR-author short-circuit: for `issue_comment` events whose `comment.user.type == "Bot"`, set `should_run=false`. The mention check still runs first, so legitimate human or bot summons (`@<bot>`) are preserved. Closes #606 Co-Authored-By: Claude <[email protected]>
|
but don't we want to know about some bot comments? what are some cases where this is really noisy? |
|
Good question — the guard is narrower than it might look. We still react to bot comments in three cases:
What we're dropping is the residual case: a bot posting a conversational Where it's actually noisy — the trigger was the Cloudflare Pages deploy bot on bot-authored regen PRs, called out in #606 with evidence from diffplug/dormouse#93:
On dormouse the Cloudflare case alone was ~$0.45 per regen PR for sessions that did nothing. Any repo with a deploy-preview bot and bot-authored PRs (nightly regens, dependency bumps) hits the same multiplier. Happy to narrow it further if you'd prefer — e.g. limit the guard to bot-authored PRs only, so undirected bot comments on human-authored PRs would still spin up a session (currently they'd also hit the engagement-history branch and usually run, but we'd be preserving that path explicitly). |
|
ok, let's proceed but add a TODO that we should reassess in the future. in the future, we could consider quick pass of a fast model to avoid kicking off a 1T param model to see it was an inane bot comment |
A small/fast-model content check could replace the blanket skip with content-aware filtering — flagged per maintainer review on #608.
|
Done — added a TODO above the guard in |
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]>
Problem
tend-mention'sverifyjob short-circuits toshould_run=truefor anyissue_commentevent on a bot-authored PR, without inspecting the comment author. Undirected bot notifications (deploy status fromcloudflare-workers-and-pages[bot], CI bots, etc.) then spin up a full agent session that always exits silently — pure waste. Because deploy bots edit their comment to update status and the workflow listens onissue_comment: [created, edited], each notification fires two no-op sessions.Solution
Add a guard in the
verifyscript between the existing@<bot>mention check and the PR-author short-circuit:COMMENT_AUTHOR_TYPEis wired fromgithub.event.comment.user.type(the public-API-visible Bot/User discriminator).Ordering matters: the @-mention check runs first, so legitimate summons (e.g. another bot writing
@<our-bot>) are still honored; the new guard runs before the PR-author short-circuit, which is what was producing the no-op sessions.Tend's own bot accounts are PAT-based user accounts (
user.type == "User"), so this does not affect tend-on-tend behavior — only true GitHub App / Bot accounts.Testing
test_mention_verify_skips_bot_comments_without_mentionasserting the guard is generated,COMMENT_AUTHOR_TYPEis wired, and the guard sits between the mention check and the PR-author short-circuit.test_workflow_minimal_regtest[mention],test_workflow_with_setup_regtest[mention],test_workflow_minimal_codex_regtest[mention]).Closes #606 — automated triage