Skip to content

fix: make *[bot] actor filter match GraphQL bot authors#1516

Open
wwhsaber wants to merge 3 commits into
anthropics:mainfrom
wwhsaber:fix/bot-actor-wildcard-graphql
Open

fix: make *[bot] actor filter match GraphQL bot authors#1516
wwhsaber wants to merge 3 commits into
anthropics:mainfrom
wwhsaber:fix/bot-actor-wildcard-graphql

Conversation

@wwhsaber

Copy link
Copy Markdown

What

Make exclude_comments_by_actor / include_comments_by_actor *[bot] wildcard actually match bot comments fetched via GraphQL.

Why

GraphQL author.login for bots has no [bot] suffix (e.g. "github-actions", "claude" with __typename: "Bot"). The matcher only checked actor.endsWith("[bot]"), which is a REST/UI convention the GraphQL path never produces — so *[bot] was a silent no-op and bot comments (including the action's own tracking comments) still entered the prompt context.

Closes #1514

Changes

  • Request author { __typename login } in PR_QUERY / ISSUE_QUERY
  • Add optional __typename on GitHubAuthor
  • Add normalizeActorLogin(): when __typename === "Bot" and login lacks [bot], append [bot] for matching (REST convention)
  • Apply normalization in filterCommentsByActor before include/exclude checks (does not mutate stored login for display)
  • Tests:
    • Unit tests for normalizeActorLogin + GraphQL-shaped matching
    • GraphQL-shaped fixtures in filterCommentsByActor tests (github-actions/claude/dependabot with __typename: "Bot")
    • Existing REST-style *[bot] fixtures still pass

Verification

bun install
bun test test/actor-filter.test.ts test/data-fetcher.test.ts

All 110 tests pass (including new GraphQL-shaped cases).

GraphQL author.login for bots omits the REST/UI [bot] suffix
(e.g. "github-actions" with __typename Bot), so exclude_comments_by_actor:
"*[bot]" was a silent no-op. Request __typename, normalize Bot logins
for matching, and add GraphQL-shaped fixture tests.

Closes anthropics#1514
@wwhsaber
wwhsaber force-pushed the fix/bot-actor-wildcard-graphql branch from 70afaa6 to da6b88f Compare July 20, 2026 03:14
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.

exclude_comments_by_actor: '*[bot]' wildcard never matches — GraphQL author.login has no [bot] suffix

2 participants