Skip to content

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

Description

@Qian-Li

Describe the bug

The documented '*[bot]' wildcard for exclude_comments_by_actor / include_comments_by_actor never matches any bot, because the two sides of the comparison come from different GitHub API conventions:

  • The matcher (src/github/utils/actor-filter.ts) implements the wildcard as actor.endsWith("[bot]").
  • The comments being filtered are fetched via GraphQL (PR_QUERY in src/github/data/fetcher.ts), and GraphQL author.login for bot actors carries no [bot] suffix — e.g. "github-actions" with __typename: "Bot", or "claude" for the Claude GitHub App. The [bot] suffix is a REST/UI convention.

So exclude_comments_by_actor: "*[bot]" is a silent no-op: every bot comment (including the action's own tracking comments from earlier runs) still enters the prompt context. The unit tests pass because their fixtures use REST-style logins like "github-actions[bot]", which the GraphQL data path never produces.

To Reproduce

  1. On any PR that has comments from github-actions or the Claude app, run:

    gh api graphql -f query='query { repository(owner:"OWNER", name:"REPO") { pullRequest(number: N) { comments(first: 20) { nodes { author { login __typename } } } } } }'

    Observe bot logins come back without the [bot] suffix (login: "github-actions", __typename: "Bot").

  2. Configure the action with exclude_comments_by_actor: "*[bot]" on a PR containing bot comments.

  3. Run the workflow; the injected <comments> context still contains the bot-authored comments.

Expected behavior

'*[bot]' matches all bot actors on the data the filter actually sees, per the input's documented description ("'*[bot]' matches all bots").

Workaround

List exact GraphQL logins: exclude_comments_by_actor: "*[bot],github-actions,claude" (exact matches work because they compare against the raw login).

Suggested fix

Either normalize in the filter (treat author.__typename === "Bot" as matching the *[bot] wildcard) or normalize at fetch time (append [bot] to logins whose __typename is Bot, matching REST convention). Also worth adding a GraphQL-shaped fixture to the actor-filter tests.

API Provider

[x] Anthropic First-Party API (default) — subscription OAuth token (claude_code_oauth_token)

Additional context

Observed and verified at v1.0.173 (f1bd27ca) and v1.0.174 (12531344); the relevant code paths are unchanged at the current tag. Verified empirically by comparing the run's injected <comments> context (bot comments present with the wildcard alone; absent once exact logins were added) and live GraphQL responses on the same PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2Non-showstopper bug or popular feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions