环境扫描结果
配置文件
| 文件 | 路径 |
|---|---|
| 项目配置 | D:\GitRepo\git.atibm.com\at\hermes-oracle-at\opencode.json |
| 全局配置 | C:\Users\cat\.config\opencode\opencode.jsonc |
安装状态
| 安装源 | 版本 | 状态 |
|---|---|---|
| Scoop(主) | 1.16.2 | ✅ 当前生效 |
| WinGet(次) | 1.15.6 | ❌ 已卸载 |
| 手动安装残留 | — | ✅ 无 |
| npm global 残留 | — | ✅ 无 |
两版本共用同一套配置文件,不产生配置冲突。WinGet 已卸载,PATH 干净。
当前配置摘要
| 配置项 | 值 | 来源 |
|---|---|---|
model | 未设置 | — |
small_model | 未设置 | — |
| 自定义 agent | 无 | — |
| 自定义 provider | v100/Qwen3.5-27B | 全局配置 |
CLI -m 参数 | 未传 | — |
模型加载优先级(官方文档)
--model/-mCLI 参数- config 中的
model字段 - 上次使用的模型
- 内置默认模型(内部优先级排序)
三个均未设置,当前走第 4 级:opencode 内置默认模型,不是你定义的 v100/Qwen3.5-27B。
切换模型后的隐藏行为分析
1️⃣ small_model 未设置 → 🔴 后台任务模型失控
small_model 的官方定义:"Small model to use for tasks like title generation"。
涉及的内置隐藏 agent:
| 隐藏 agent | 用途 | 触发时机 |
|---|---|---|
title | 自动生成对话标题 | 每次用户发消息后 |
summary | 生成对话摘要 | 共享/存档时 |
compaction | 压缩长上下文 | 上下文窗口满时 |
模型路由规则:
- 若
small_model设置了 → 用small_model - 若
small_model未设置 → 回退到主model
你的 small_model 未设置 → 它们用了你的主模型(昂贵)而不是一个小模型。这不是"跑错模型",而是"不该用大模型的任务用了大模型",浪费 token/成本。
2️⃣ Subagent 继承规则 → 🟢 通常正确
官方文档:
"If you don't specify a model, primary agents use the globally configured model, while subagents will use the model of the primary agent that invoked them."
| 内置 subagent | 模型来源 |
|---|---|
general | 继承调用方的主 agent 模型 |
explore | 继承调用方的主 agent 模型 |
scout | 继承调用方的主 agent 模型 |
你没有自定义 agent,所以:切换主模型 → subagent 跟着走,行为正确。
3️⃣ command 可独立指定模型 → 🟢 无风险
配置 schema 显示 command 可以有自己的 model 字段,但你没有定义 command,不适用。
4️⃣ agent 可独立指定模型 → 🟢 无风险
每个 agent 都可以有独立 model,但你没有为任何内置 agent 指定 model,他们都走继承链。
总结:模型失控全景
| 场景 | 当前风险 | 原因 |
|---|---|---|
| 主对话 | 🔴 不是 Qwen | model 未设置,走内置默认模型 |
title 自动标题 | 🔴 浪费 | small_model 未设置,回退到主模型 |
summary 摘要 | 🔴 浪费 | 同上 |
compaction 压缩 | 🔴 浪费 | 同上 |
@general subagent | 🟢 正确 | 继承主 agent 模型 |
@explore subagent | 🟢 正确 | 同上 |
| 自定义 command | 🟢 无风险 | 未定义 |
| 自定义 agent | 🟢 无风险 | 未定义 |
修复建议
在全局配置 C:\Users\cat\.config\opencode\opencode.jsonc 中显式设置:
{
"$schema": "https://opencode.ai/config.json",
"model": "v100/Qwen3.5-27B",
"small_model": "v100/Qwen3.5-27B",
"provider": {
"v100": {
"name": "v100",
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://v1008080.atibm.com/v1"
},
"models": {
"Qwen3.5-27B": {
"name": "Qwen3.5-27B"
}
}
}
}
}