Skip to content

mode: agent does not bypass trigger detection in beta — exits with 'No trigger found, skipping' #1197

@herherszt

Description

@herherszt

Summary

Setting mode: agent (per the action.yml description: "agent (for automation with no trigger checking)") does not actually bypass trigger detection in the @beta tag. The action's prepare phase still runs trigger detection, finds nothing, logs "No trigger found, skipping remaining steps", and exits with success (job ~18s) without invoking Claude.

Reproduction

Workflow on a private monorepo, triggered by pull_request event:

name: AI Code Review
on:
  pull_request:
    types: [opened, synchronize]
    paths:
      - 'packages/**'

permissions:
  contents: read
  pull-requests: write
  issues: write
  actions: read

jobs:
  review:
    runs-on: ubuntu-latest
    if: github.event.pull_request.draft == false
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }

      - name: AI Code Review
        uses: anthropics/claude-code-action@beta
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          github_token: ${{ secrets.GITHUB_TOKEN }}  # explicit, to bypass OIDC validation
          mode: agent                                 # ← supposed to skip trigger detection
          model: claude-opus-4-6
          allowed_tools: "Bash,Read,Grep,Glob,Task"
          direct_prompt: |
            # ... ~2KB inline prompt with concrete instructions ...

Observed

Job log:

Using provided GITHUB_TOKEN for authentication
Checking permissions for actor: <user>
Permission level retrieved: admin
Actor has write access: admin
No trigger found, skipping remaining steps

Job exits successful in ~18 seconds. Claude never runs. No PR comment posted.

Expected

Per the input description in action.yml:

mode: Execution mode for the action. Valid modes: 'tag' (default - triggered by mentions/assignments), 'agent' (for automation with no trigger checking), 'experimental-review' (...)

I expected mode: agent to bypass the trigger phrase / label / mention detection entirely and execute Claude unconditionally. Instead, trigger detection still runs and (correctly) finds no @claude mention or claude label, then exits.

Workaround

Removing mode: agent and relying on direct_prompt's own bypass behavior (per its description: "Direct instruction for Claude (bypasses normal trigger detection)") works:

- name: AI Code Review
  uses: anthropics/claude-code-action@beta
  with:
    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
    github_token: ${{ secrets.GITHUB_TOKEN }}
    # no mode: agent
    model: claude-opus-4-6
    allowed_tools: "Bash,Read,Grep,Glob,Task"
    direct_prompt: |
      # ... same prompt ...

With this, the action correctly invokes Claude (~5min run, full PR review). So either:

  • (a) mode: agent has a regression in the beta tag that broke its bypass logic, or
  • (b) direct_prompt's bypass and mode: agent's bypass are mutually exclusive in some unexpected way, or
  • (c) The action.yml description for mode is misleading and agent mode requires additional configuration not documented.

Environment

  • Action: anthropics/claude-code-action@beta
  • Trigger event: pull_request (types: opened, synchronize)
  • Repo: private monorepo
  • Date: 2026-04-08
  • Anthropic model: claude-opus-4-6

Suggestion

Either (1) fix mode: agent to actually bypass trigger detection as documented, or (2) update the action.yml description to clarify that direct_prompt is the canonical bypass mechanism and mode: agent requires X/Y/Z additional setup. The current state is a footgun: the docs read as if mode: agent is the right choice for non-mention-driven automation, but it silently no-ops.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions