
最近在用 Claude Agent SDK 开发,由于公司安全限制,只能使用百炼模型,因此我设置了
ANTHROPIC_BASE_URL=https://dashscope.aliyuncs.com/apps/anthropic ANTHROPIC_MODEL=qwen3-max ANTHROPIC_SMALL_FAST_MODEL=qwen-plus 但是触发 Sub-Agent 时(比如 Explore ),强制使用 qwen3-max 会报错,导致 Sub-Agent 无法使用。大家遇到这个问题了吗?有什么解法吗?
{ "round":4, "session_id":"20251223_175114", "message_type":"UserMessage", "message":{ "parent_tool_use_id":null, "uuid":"da69a48d-9f57-4f1f-a0a3-0309aa4a3054", "content":[ { "tool_use_id":"call_d32dc053b6424cec868932ca", "is_error":true, "content":"<tool_use_error>InputValidationError: [\n {\n \"received\": \"qwen3-max\",\n \"code\": \"invalid_enum_value\",\n \"options\": [\n \"sonnet\",\n \"opus\",\n \"haiku\"\n ],\n \"path\": [\n \"model\"\n ],\n \"message\": \"Invalid enum value. Expected 'sonnet' | 'opus' | 'haiku', received 'qwen3-max'\"\n }\n]</tool_use_error>" } ] }, "timestamp":"2025-12-23T17:51:24.784456" } [ { "received": "qwen3-max", "code": "invalid_enum_value", "options": [ "sonnet", "opus", "haiku" ], "path": [ "model" ], "message": "Invalid enum value. Expected 'sonnet' | 'opus' | 'haiku', received 'qwen3-max'" } ] 1 Vaspike 1 天前 只有阿里的官方文档能告诉你原因, 要么就听这个报错的把模型名称换成 sonnet 或 opus, 反正你 baseUrl 已经是阿里的了 |