fix: #142 子Agent模型配置不再被全局主模型覆盖 + #143 nvm/fnm版本按倒序排列

- models.js: 移除 applyDefaults 中强制同步全局 primary 到所有子 Agent 的逻辑 (#142)
- mod.rs: nvm/fnm 版本目录按文件名倒序排列,最新版优先 (#143,macOS + Linux)
This commit is contained in:
晴天
2026-03-26 02:11:53 +08:00
parent 7de40624f7
commit 1141b5867b
2 changed files with 33 additions and 29 deletions

View File

@@ -741,15 +741,9 @@ function applyDefaultModel(state) {
for (const fb of fallbacks) modelsMap[fb] = {}
defaults.models = modelsMap
// 同步到各 agent 的模型覆盖配置,避免 agent 级别的旧值覆盖全局默认
const list = state.config.agents?.list
if (Array.isArray(list)) {
for (const agent of list) {
if (agent.model && typeof agent.model === 'object' && agent.model.primary) {
agent.model.primary = primary
}
}
}
// 注意:不再强制同步到各 agent 的 model.primary
// 子 Agent 的模型覆盖是 OpenClaw 正常功能(用户可通过对话为不同 Agent 设置不同模型)
// 强制覆盖会导致 #142重开 ClawPanel 后子 Agent 模型配置被重置
}
// 顶部按钮事件