Skip to content

claude.yml: the opened mention gate is formatting-blind, so discussing the bot dispatches a run #554

Description

@d-morrison

Split out of #298 before merging #552, so the remainder is not lost when the parent closes.

#298 raised two coupled problems. #552 ships the first — assignment as a sufficient trigger, via dispatch-on-assignee. This is the second, quoted from #298's own problem statement:

opened genuinely needs a content signal, since every new issue fires it. But the substring match is formatting-blind, so an issue that merely discusses the bot in a code span dispatches a full run (four instances so far; most recently ai-config#682 -> #683, which ran ~8 minutes and then died at the push step).

Why it is not simply "reuse the gha#342 fix"

gha#342 already solved this class inside the job: detect-bot-mention pipes the body through strip-non-invoking-markup.sh, which removes blockquotes, fenced blocks, indented blocks, and inline code spans, so a quoted mention no longer dispatches an agent run or a review re-dispatch.

What it does not fix is the job-level if:, and gha's own CLAUDE.md already says why:

Note what it does not fix: claude-bot.yml's job-level if: still tests the raw body, because a GitHub expression cannot strip Markdown, so the job still starts and the runner still spins up.

So the remaining cost is bounded but real: a runner spins up, the checkout runs, and the job stands down at the gate. What #342 removed was the billed agent run; what is left is the runner time and a confusing skipped job on an issue that was only talking about the bot.

Directions, none obviously right

  1. Accept it. The expensive half is already fixed, and a GitHub expression genuinely cannot strip Markdown. Document the residual and close.
  2. Cheap pre-job filter. A tiny first job that runs the stripper and gates the real job on its output — moves the decision out of the expression language at the cost of one extra job per event.
  3. Narrow the expression heuristic. e.g. require the mention at a line start, or not immediately preceded by a backtick. Partial by construction, and Bot mention trigger matches inside code spans and blockquotes, so writing about the bot invokes it #342's own history is a warning about approximating CommonMark: it tracks the spec closely because under- and over-stripping land on different callers.

Direction 3 looks worst — it re-opens the approximation problem #342 deliberately closed, in a language that cannot express the fix. Between 1 and 2, the question is whether the residual runner time is worth an extra job on every triggering event, which is a maintainer call rather than a technical one.

Related

Not claimed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions