Skip to content

Seeing "Invalid model name" error #12

@matt-allpress

Description

@matt-allpress

When I run this GitHub Action I get an "Invalid model name" error. I've copied the output of the 'Run Claude PR Action' step below (from line 615).

If I type the full output into Claude Code it says the following:

Looking at the logs, I can see the GitHub Action is trying to use a model called claude-opus-4-20250514, which doesn't exist. The valid Claude model names should
be:

  • claude-3-5-sonnet-20241022 (latest Sonnet)
  • claude-3-opus-20240229
  • claude-3-haiku-20240307

The file-not-found errors you see at the beginning are just warnings - they happen when the Action tries to analyze files that were moved/deleted in your PR,
which is normal.

To fix this:

  1. Check your GitHub Action configuration - Look for a .github/workflows/ file that references the Claude action and see if there's a model configuration
  2. Or check if there's a model setting in your repository secrets - Go to Settings → Secrets and variables → Actions and look for any model-related settings

The issue is that claude-opus-4-20250514 isn't a real model name. It should probably be claude-3-opus-20240229 or one of the other valid model names above.

If you can't find where this model name is configured, you might need to check the action version you're using (grll/claude-code-action@beta) to see if it has
incorrect defaults, or switch to the official Anthropic action.

I have Claude Pro (not Max). Let me know if I've set it up wrong or you need more info.

=======================
Run grll/claude-code-base-action@30f4e17267bd0172ae76f7a3a10593c44811b230
Run actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
Found in cache @ /opt/hostedtoolcache/node/18.20.8/x64
Environment details
Run oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76
Downloading a new version of Bun: https://bun.sh/download/1.2.11/linux/x64?avx2=true&profile=false
/usr/bin/unzip -o -q /home/runner/work/_temp/fe891842-b8b5-44ef-9dbf-a77a575729d0.zip
/home/runner/.bun/bin/bun --revision
1.2.11+cb6abd211
Run cd ${GITHUB_ACTION_PATH}
bun install v1.2.11 (cb6abd21)

+ @types/bun@1.2.12
+ @types/node@20.17.32
+ prettier@3.5.3
+ typescript@5.8.3
+ @actions/core@1.11.1

13 packages installed [178.00ms]
Run npm install -g @anthropic-ai/claude-code@1.0.24

added 3 packages in 3s

2 packages are looking for funding
  run `npm fund` for details
Run # Change to CLAUDE_WORKING_DIR if set (for running in custom directories)
OAuth credentials written to /home/runner/.claude/.credentials.json
Setting up Claude settings at: /home/runner/.claude/settings.json
Creating .claude directory...
No existing settings file found, creating new one
Updated settings with enableAllProjectMcpServers: true
Settings saved successfully
Prompt file size: 21205 bytes
Running Claude with prompt from file: /home/runner/work/_temp/claude-prompts/claude-prompt.txt
{
  "type": "system",
  "subtype": "init",
  "cwd": "/home/runner/...MASKED...",
  "session_id": "9985fc66-574b-4966-a7f6-d291ed962219",
  "tools": [
    "Task",
    "Bash",
    "Glob",
    "Grep",
    "LS",
    "exit_plan_mode",
    "Read",
    "Edit",
    "MultiEdit",
    "Write",
    "NotebookRead",
    "NotebookEdit",
    "TodoRead",
    "TodoWrite",
    "mcp__github_file_ops__commit_files",
    "mcp__github_file_ops__delete_files",
    "mcp__github_file_ops__update_claude_comment"
  ],
  "mcp_servers": [
    {
      "name": "github_file_ops",
      "status": "connected"
    }
  ],
  "model": "claude-opus-4-20250514",
  "permissionMode": "default",
  "apiKeySource": "none"
}
{
  "type": "assistant",
  "message": {
    "id": "af3331e9-49c8-43e1-a9ad-e2a30c9e853e",
    "model": "<synthetic>",
    "role": "assistant",
    "stop_reason": "stop_sequence",
    "stop_sequence": "",
    "type": "message",
    "usage": {
      "input_tokens": 0,
      "output_tokens": 0,
      "cache_creation_input_tokens": 0,
      "cache_read_input_tokens": 0,
      "server_tool_use": {
        "web_search_requests": 0
      }
    },
    "content": [
      {
        "type": "text",
        "text": "API Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"system: Invalid model name\"}}"
      }
    ]
  },
  "parent_tool_use_id": null,
  "session_id": "9985fc66-574b-4966-a7f6-d291ed962219"
}
{
  "type": "result",
  "subtype": "success",
  "is_error": true,
  "duration_ms": 643,
  "duration_api_ms": 0,
  "num_turns": 1,
  "result": "API Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"system: Invalid model name\"}}",
  "session_id": "9985fc66-574b-4966-a7f6-d291ed962219",
  "total_cost_usd": 0,
  "usage": {
    "input_tokens": 0,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "output_tokens": 0,
    "server_tool_use": {
      "web_search_requests": 0
    }
  }
}
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions