[BUG] Fallback model only triggers on overload, not on other failure scenarios
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The fallback model functionality only triggers when the primary model is "overloaded" but doesn't work for other common failure scenarios like server downtime, invalid model names, or model unavailability. This causes unnecessary CI/CD pipeline failures even when a backup model is configured and available, particularly when specific models experience downtime as shown on Claude Status page.
What Should Happen?
When the primary model fails due to being invalid, server downtime, model-specific outages, network issues, or other non-overload failures, the action should automatically retry with the configured fallback model instead of failing completely.
Error Messages/Logs
Steps to Reproduce
Steps to reproduce the behavior:
- Configure claude-code-action with an invalid primary model and valid fallback model:
````
claude_args: |
--model claude-invalid-model-name
--fallback-model claude-sonnet-4-20250514
- Run the GitHub Action
- See the action fail completely instead of falling back to the valid Sonnet fallback model
- This simulates the same scenario as when models are down or unavailable in production
Alternatively, running claude --model claude-invalid-model-name --fallback-model claude-sonnet-4-20250514 in the terminal also fails in the same way.
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
2.0.0
Claude Code Version
2.0.0
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Claude Code
<img width="1816" height="652" alt="Image" src="https://github.com/user-attachments/assets/28261f8b-039b-4d98-bd26-53d1f0bea09e" />
Claude Code Actions
<img width="1168" height="1716" alt="Image" src="https://github.com/user-attachments/assets/6e25739d-3a71-4dfb-a342-e69d1612e82c" />
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗