[Bug] [CLI] Anthropic provider defaults to retired claude-sonnet-4-20250514 (404 not_found_error)
Search before asking
- [X] I had searched in the issues and found no similar issues.
What happened
With AI_PROVIDER=anthropic and no ANTHROPIC_MODEL set, the SeaTunnel AI CLI (seatunnel-cli) calls the Anthropic Messages API with claude-sonnet-4-20250514. That's the fallback in AnthropicProvider.__init__ (seatunnel_cli/llm_provider.py), and seatunnel --init shows it as the default for the Anthropic provider.
Anthropic retired Claude Sonnet 4 (claude-sonnet-4-20250514) on 2026-06-15 (model deprecations), so the API answers with 404 not_found_error and every primary-model request (config generation, the agent loop) fails. The README and env.example.sh also suggest ANTHROPIC_MODEL=claude-sonnet-4-20250514 as the override, so copying the docs gives the same error.
The fast-model default claude-haiku-4-5-20251001 is still available. The Bedrock default (us.anthropic.claude-sonnet-4-20250514-v1:0) follows AWS's own model lifecycle, so this issue is only about the direct Anthropic provider.
SeaTunnel Version
dev (seatunnel-cli)
SeaTunnel Config
N/A, the failure happens before a job config is generated.
Running Command
export AI_PROVIDER=anthropic
export ANTHROPIC_API_KEY=sk-ant-...
seatunnel
# then ask it to generate any job config
Error Exception
anthropic.NotFoundError: Error code: 404 - {'type': 'error', 'error': {'type': 'not_found_error', 'message': 'model: claude-sonnet-4-20250514'}}
Zeta or Flink or Spark Version
N/A
Java or Scala Version
N/A
Screenshots
N/A
Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Suggested fix
Default to a current model. AnthropicProvider.chat always sends temperature, so it should be one that still accepts it, e.g. claude-sonnet-4-6, and the docs examples should match.
Thanks for the precise report. Current dev still sets the direct Anthropic provider default to claude-sonnet-4-20250514 in seatunnel-cli/seatunnel_cli/llm_provider.py, and both English and Chinese CLI examples show the same identifier. This is limited to the direct Anthropic provider; the Bedrock identifier is a different provider contract.
Please open one focused fix PR that updates the direct-provider default, the EN/ZH README examples, env.example.sh if it contains the value, and a regression test for the default. The replacement must be a currently supported direct Anthropic model ID verified with the current SDK request shape, including the temperature parameter used by this provider; do not substitute a Bedrock model ID. The PR should state the direct API smoke-test result and keep ANTHROPIC_MODEL as the explicit override for deployments that need a different approved model.