Skip to content

claude_args --model silently ignored in tag mode #1223

@rmalve

Description

@rmalve

Describe the bug
The --model flag inside the claude_args input is silently ignored when the action runs in tag mode (triggered by @claude mentions in issue_comment, pull_request_review_comment, pull_request_review, or issues events).

The SDK initializes with the tag-mode default model (claude-sonnet-4-6) regardless of what model is specified via claude_args. No warning is logged.

The example in action.yml inline comments and in examples/claude.yml both show --model being pinned through claude_args, which primes users to expect the flag to work.

To Reproduce

Steps to reproduce the behavior:

  1. Install anthropics/claude-code-action@v1 in a repo with a
    workflow that pins a non-default model via claude_args: | --model
    claude-haiku-4-5-20251001
  2. Merge the workflow to the default branch
  3. Open any PR and leave a comment containing @claude
  4. Open the triggered workflow run and expand the "Run Claude Code"
    step
  5. Observe the { "type": "system", "subtype": "init" } line reports
    "model": "claude-sonnet-4-6" instead of the pinned Haiku 4.5

Expected behavior
The SDK should initialize with whatever model is specified via --model in claude_args. At minimum, if the tag mode code path overrides the user-supplied flag by design, the action should log a visible warning so users know their pin has been ignored.

Screenshots

Workflow yml file

name: Claude Code

on:
    issue_comment:
      types: [created]
    pull_request_review_comment:
      types: [created]
    issues:
      types: [opened, assigned]
    pull_request_review:
      types: [submitted]

jobs:
    claude:
      if: |
        (github.event_name == 'issue_comment' &&
  contains(github.event.comment.body, '@claude')) ||
        (github.event_name == 'pull_request_review_comment' &&        
  contains(github.event.comment.body, '@claude')) ||
        (github.event_name == 'pull_request_review' &&
  contains(github.event.review.body, '@claude')) ||
        (github.event_name == 'issues' &&
  (contains(github.event.issue.body, '@claude') ||
  contains(github.event.issue.title, '@claude')))
      runs-on: ubuntu-latest
      permissions:
        contents: write
        pull-requests: write
        issues: write
        id-token: write
        actions: read
      steps:
        - name: Checkout repository
          uses: actions/checkout@v6
          with:
            fetch-depth: 1

        - name: Run Claude Code
          id: claude
          uses: anthropics/claude-code-action@v1
          with:
            anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}       
            claude_args: |
              --model claude-haiku-4-5-20251001

API Provider

[x] Anthropic First-Party API (default)
[ ] AWS Bedrock
[ ] GCP Vertex

Additional context

  • SDK version: @anthropic-ai/claude-agent-sdk@0.2.109
  • Bun version: 1.3.6
  • Action version: anthropics/claude-code-action@v1
  • Workaround found: use settings.env.ANTHROPIC_MODEL instead of
    claude_args --model. The SDK reads the env var at initialization,
    before tag-mode resolution applies. Confirmed working in a
    subsequent run where the init event correctly reported "model":
    "claude-haiku-4-5-20251001".
  • The commented example in the action's own action.yml shows --model
    being set via claude_args.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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