Skip to content
FunCoding

Search

Search docs, Skills and MCP

Subagent 模型选择

配置 inherit、fast、跨提供商模型、Explore 覆盖和可供模型选择的等级。

This page has not been translated into English yet. The original Chinese version is shown below.

常规 subagent 可以继承主模型,也可以使用已有提供商目录中的另一模型。切换提供商同时改变该 subagent 请求发送的位置,应按任务数据选择。

定义文件中的 model

值解析行为
省略或 inherit与主对话同一模型
fast使用 fastModel;没有有效配置时回退为继承
单独模型 ID先检查主对话认证类型,再尝试其他已配置提供商
authType:modelId显式选择认证类型与模型

例如:

---
name: quick-reviewer
description: Review small changes with the configured fast model.
model: fast
tools:
  - read_file
  - grep_search
---

Identify concrete defects in the requested files and cite the evidence.

fast 使用 settings.json 或 /model --fast 配置的同一选择器。若它解析到另一认证类型,Qwen Code 为该请求建立对应运行时提供商,并只把裸模型 ID 发给服务。它不会因为主会话已认证就自动拥有其他服务的凭据。

单独调整 Explore

内置 Explore 默认继承主模型;早期版本默认使用 fastModel。要恢复早期行为:

{
  "agents": {
    "builtin": {
      "exploreModel": "fast"
    }
  }
}

修改后重启。该字段支持同样的选择器,但只作用于内置 Explore;若会话、项目、个人或扩展定义了同名 Explore,它保留自己的 model。

模型等级

希望让主模型按工作规模选择档位,而不暴露具体模型 ID,可配置 agents.modelGrades,并用 agents.allowedGrades 限制可选项。示例中的两个等级都引用已有 fast 配置,可按实际目录更换选择器:

{
  "agents": {
    "modelGrades": {
      "small": "fast",
      "review": "fast"
    },
    "allowedGrades": ["small", "review"]
  }
}

随后常规 Agent 调用的 model 参数可以选 small 或 review。未知、未允许的等级会被拒绝;fork 和具名团队队友不接受这种等级选择。自定义 agent 定义里显式 model 的优先级高于调用时的等级。

模型目录与凭据配置见提供商。外部 Claude Code、Codex 执行器使用自己的模型配置,不适用这一页的覆盖机制。