Claude Code 的模型清單加長:別名 fable,加上目前的完整名稱(opus/sonnet/haiku 之外)

- src/claudecli.rs MODELS:opus、sonnet、haiku、fable,加上 claude-opus-5-5、claude-sonnet-5-5、claude-haiku-5-5、claude-fable-5-2、claude-opus-4-8、claude-sonnet-4-6(取自 CLI 內建的模型目錄)
- 功能地圖 claudecode 與 FEATURES 同步

已驗證: cargo test 全部 927 通過(含 claudecli::、providers::、featuremap::、tool_specs_are_locked、approval_decisions_are_characterized)
未驗證: 訂閱帳號實際能用哪些名稱(要送請求才會知道,會用掉額度);CLI 沒有列出可用模型的指令,清單是寫死的

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
王性驊 2026-11-26 14:04:31 +08:00
parent bdd3cc6003
commit 63d55d605e
3 changed files with 17 additions and 3 deletions

View File

@ -693,7 +693,7 @@ AnyBot 是一個桌面聊天 App,介面和運作方式照 Grok Bot 重做。
| 「xAI Grok」 | https://api.x.ai/v1 | grok-4 | grok-4、grok-4-fast、grok-3-mini | 要 | XAI_API_KEY | 「在 console.x.ai 取得 API 金鑰」 | | 「xAI Grok」 | https://api.x.ai/v1 | grok-4 | grok-4、grok-4-fast、grok-3-mini | 要 | XAI_API_KEY | 「在 console.x.ai 取得 API 金鑰」 |
| 「OpenAI」 | https://api.openai.com/v1 | gpt-5 | gpt-5、gpt-5-mini、gpt-4.1 | 要 | OPENAI_API_KEY | 「在 platform.openai.com 取得 API 金鑰」 | | 「OpenAI」 | https://api.openai.com/v1 | gpt-5 | gpt-5、gpt-5-mini、gpt-4.1 | 要 | OPENAI_API_KEY | 「在 platform.openai.com 取得 API 金鑰」 |
| 「Claude」 | https://api.anthropic.com/v1 | claude-opus-5-5 | claude-opus-5-5、claude-sonnet-5-5、claude-haiku-5-5、claude-fable-5-1 | 要 | ANTHROPIC_API_KEY | 「在 console.anthropic.com 取得 API 金鑰」 | | 「Claude」 | https://api.anthropic.com/v1 | claude-opus-5-5 | claude-opus-5-5、claude-sonnet-5-5、claude-haiku-5-5、claude-fable-5-1 | 要 | ANTHROPIC_API_KEY | 「在 console.anthropic.com 取得 API 金鑰」 |
| 「Claude Code」 | (無:用這台電腦的 claude 指令,見 `src/claudecli.rs`) | sonnet | opus、sonnet、haiku | 不用 | – | 「用這台電腦上已登入的 Claude Code(Claude 訂閱),不用 API 金鑰:先安裝 claude,再在終端機執行 claude auth login」 | | 「Claude Code」 | (無:用這台電腦的 claude 指令,見 `src/claudecli.rs`) | sonnet | opus、sonnet、haiku、fable 和 4 個完整名稱(見 `src/claudecli.rs`) | 不用 | – | 「用這台電腦上已登入的 Claude Code(Claude 訂閱),不用 API 金鑰:先安裝 claude,再在終端機執行 claude auth login」 |
| 「Google Gemini」 | https://generativelanguage.googleapis.com/v1beta/openai | gemini-2.5-flash | gemini-2.5-flash、gemini-2.5-pro | 要 | GEMINI_API_KEY | 「在 aistudio.google.com 取得 API 金鑰」 | | 「Google Gemini」 | https://generativelanguage.googleapis.com/v1beta/openai | gemini-2.5-flash | gemini-2.5-flash、gemini-2.5-pro | 要 | GEMINI_API_KEY | 「在 aistudio.google.com 取得 API 金鑰」 |
| 「OpenRouter」 | https://openrouter.ai/api/v1 | openrouter/auto | openrouter/auto | 要 | OPENROUTER_API_KEY | 「在 openrouter.ai 取得 API 金鑰」 | | 「OpenRouter」 | https://openrouter.ai/api/v1 | openrouter/auto | openrouter/auto | 要 | OPENROUTER_API_KEY | 「在 openrouter.ai 取得 API 金鑰」 |
| 「Ollama」 | http://localhost:11434/v1 | llama3.2 | llama3.2、qwen2.5、gemma3 | 不用 | – | 「先安裝並開啟 Ollama,不需要金鑰」 | | 「Ollama」 | http://localhost:11434/v1 | llama3.2 | llama3.2、qwen2.5、gemma3 | 不用 | – | 「先安裝並開啟 Ollama,不需要金鑰」 |

View File

@ -4,7 +4,7 @@
## 子功能 ## 子功能
- `claudecode-run` 當大腦:在 設定 › 模型 或 Bot 設定選「Claude Code」,每一步就用這台電腦的 `claude` 指令跑。沒有金鑰、沒有服務網址;模型是 opus、sonnet、haiku(跟著 Claude Code 的最新版)。雲端大腦(伺服器上的大腦)沒有 `claude`,選了會回「找不到 Claude Code」;要在雲端用就選「Claude」(API 金鑰),或把這台電腦當大腦(見陷阱)。 - `claudecode-run` 當大腦:在 設定 › 模型 或 Bot 設定選「Claude Code」,每一步就用這台電腦的 `claude` 指令跑。沒有金鑰、沒有服務網址;模型清單是別名 opus、sonnet、haiku、fable(跟著 Claude Code 的最新版)加上目前幾個完整名稱;帳號不能用的名字,那一步回 Claude Code 自己的錯誤。雲端大腦(伺服器上的大腦)沒有 `claude`,選了會回「找不到 Claude Code」;要在雲端用就選「Claude」(API 金鑰),或把這台電腦當大腦(見陷阱)。
- `claudecode-missing` 沒裝或沒登入:找不到 `claude` 時,Bot 回「找不到 Claude Code(claude 指令)…」;還沒登入時說明要執行 `claude auth login`。格子寫「未設定」,裝好重新開啟 AnyBot 後寫「可以用」。 - `claudecode-missing` 沒裝或沒登入:找不到 `claude` 時,Bot 回「找不到 Claude Code(claude 指令)…」;還沒登入時說明要執行 `claude auth login`。格子寫「未設定」,裝好重新開啟 AnyBot 後寫「可以用」。
- `claudecode-tools` 工具與審批不變:Claude 的內建工具全部關掉,它要用工具就在回答裡提出,AnyBot 照原來的規則處理,要問的照樣出卡片。 - `claudecode-tools` 工具與審批不變:Claude 的內建工具全部關掉,它要用工具就在回答裡提出,AnyBot 照原來的規則處理,要問的照樣出卡片。
- `claudecode-answer` 回答與圖片:整段說完才出現(不逐字),圖片和截圖直接給 Claude 看;訂閱額度用完時說「已達用量上限」,Bot 有備用模型就換。 - `claudecode-answer` 回答與圖片:整段說完才出現(不逐字),圖片和截圖直接給 Claude 看;訂閱額度用完時說「已達用量上限」,Bot 有備用模型就換。

View File

@ -26,7 +26,21 @@ const ALIVE_EVERY: Duration = Duration::from_secs(1);
/// The model when a bot names none: the CLI's own alias for the newest Sonnet. /// The model when a bot names none: the CLI's own alias for the newest Sonnet.
const DEFAULT_MODEL: &str = "sonnet"; const DEFAULT_MODEL: &str = "sonnet";
/// The aliases the CLI takes; each follows the newest model of its family. /// The aliases the CLI takes; each follows the newest model of its family.
pub const MODELS: [&str; 3] = ["opus", "sonnet", "haiku"]; /// The aliases the CLI takes (they follow its latest model) and the current full names from the
/// CLI's own model list. The CLI has no command to list what a subscription can use, so this is
/// the list; a name the account can't use fails at the step with the CLI's own message.
pub const MODELS: [&str; 10] = [
"opus",
"sonnet",
"haiku",
"fable",
"claude-opus-5-5",
"claude-sonnet-5-5",
"claude-haiku-5-5",
"claude-fable-5-2",
"claude-opus-4-8",
"claude-sonnet-4-6",
];
const CLI_NAME: &str = if cfg!(windows) { "claude.exe" } else { "claude" }; const CLI_NAME: &str = if cfg!(windows) { "claude.exe" } else { "claude" };