fix: remove unnecessary lock mechanism and upgrade Claude 3 to Claude 4

- Remove sync.RWMutex and rrCounters from Config struct
- Simplify GetModelConfig to use global atomic counter for load balancing
- Remove unnecessary locks from HasProvidersConfig, SaveConfig, etc.
- Add buildModelWithProtocol helper to handle models with existing prefix
- Fix TestCreateProviderReturnsHTTPProviderForOpenRouter to use model_list
- Upgrade all Claude 3 references to Claude 4 across documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yinwm
2026-02-20 11:34:52 +08:00
parent b7c906fe18
commit 5cd1597674
14 changed files with 134 additions and 100 deletions
+5 -5
View File
@@ -58,8 +58,8 @@ The new `model_list` configuration offers several advantages:
"api_base": "https://api.openai.com/v1"
},
{
"model_name": "claude3",
"model": "anthropic/claude-3-sonnet",
"model_name": "claude-sonnet-4",
"model": "anthropic/claude-sonnet-4",
"api_key": "sk-ant-your-key"
},
{
@@ -83,12 +83,12 @@ The `model` field uses a protocol prefix format: `[protocol/]model-identifier`
| Prefix | Description | Example |
|--------|-------------|---------|
| `openai/` | OpenAI API (default) | `openai/gpt-5.2` |
| `anthropic/` | Anthropic API | `anthropic/claude-3-opus` |
| `anthropic/` | Anthropic API | `anthropic/claude-opus-4` |
| `antigravity/` | Google via Antigravity OAuth | `antigravity/gemini-2.0-flash` |
| `claude-cli/` | Claude CLI (local) | `claude-cli/claude-3-sonnet` |
| `claude-cli/` | Claude CLI (local) | `claude-cli/claude-sonnet-4` |
| `codex-cli/` | Codex CLI (local) | `codex-cli/codex-4` |
| `github-copilot/` | GitHub Copilot | `github-copilot/gpt-4o` |
| `openrouter/` | OpenRouter | `openrouter/anthropic/claude-3` |
| `openrouter/` | OpenRouter | `openrouter/anthropic/claude-sonnet-4` |
| `groq/` | Groq API | `groq/llama-3.1-70b` |
| `deepseek/` | DeepSeek API | `deepseek/deepseek-chat` |
| `cerebras/` | Cerebras API | `cerebras/llama-3.3-70b` |