Skip to content

Treat user-account bot comments as innocent in triage - #31

Merged
matthewp merged 1 commit into
mainfrom
factory-triage-17991
Sep 15, 2026
Merged

matthewp merged 1 commit into
mainfrom
factory-triage-17991

Conversation

@matthewp

Copy link
Copy Markdown
Contributor

Changes

  • Fixes triage reacting to other bots' comments. Bot detection previously relied only on GitHub's user.type === 'Bot', which is set for app accounts but not for classic bots running on user accounts — like withastro's astrobot-houston. Its comment on #17991 started a retriage that swapped the maintainer-set triage: needs reproduction label away (needs reproduction → needs triage → in progress → unable to reproduce).
  • Adds isBotAuthor() in src/github/bots.ts: flags [bot]-suffixed app logins (GitHub's own app convention, as a belt-and-braces fallback) plus a known list of user-account bots (astrobot-houston).
  • The router now drops issue_comment.created deliveries from bot authors before dispatch, so a bot comment can no longer start a triage at all.
  • Defense in depth in the triage workflow: a queued comment delivery whose author is a bot is skipped instead of routed through the FSM, so deliveries enqueued before this change also cannot move labels.
  • Fetched issue comments now mark known user-account bots as bot-authored, so the retriage judge and fix verifier no longer read bot messages as human input.

Testing

  • tests/bots.test.ts (new): isBotAuthor coverage — app [bot] suffix, known user-account bot, human logins, missing/empty logins.
  • tests/router.test.ts: comment from astrobot-houston (type User) is dropped; [bot]-suffixed author is dropped even when the type field is missing from the payload.

Docs

  • No docs update needed: internal Worker behavior with no user-facing surface.

Bot detection relied solely on user.type === 'Bot', which GitHub only
sets for app accounts. Classic bots that run on plain user accounts
(e.g. withastro's astrobot-houston) are typed 'User', so their comments
slipped past the router and the FSM treated them as human activity.

On issue withastro/astro#17991 that made the factory retriage the issue
and swap the maintainer-set 'triage: needs reproduction' label away
(needs reproduction -> needs triage -> in progress -> unable to
reproduce).

- Add isBotAuthor() (src/github/bots.ts): flags '[bot]'-suffixed app
  logins and known user-account bots (astrobot-houston).
- Router: drop issue_comment deliveries from bot authors before dispatch.
- Triage workflow: skip 'comment' deliveries whose commentAuthor is a
  bot, so already-queued deliveries from before this fix cannot drop a
  label either (defense in depth).
- fetchIssueDetails: mark known user-account bots as authorIsBot so the
  conversation the retriage judge and fix verifier read no longer treats
  them as human input.
@matthewp
matthewp merged commit a90fc5c into main Sep 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant