Просмотр исходного кода

fix: keep primary model after subagent runs (#8951)

Seth Carlton 1 месяц назад
Родитель
Сommit
08b94a6890
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

+ 2 - 2
packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

@@ -145,9 +145,9 @@ export function Prompt(props: PromptProps) {
       const isPrimaryAgent = local.agent.list().some((x) => x.name === msg.agent)
       if (msg.agent && isPrimaryAgent) {
         local.agent.set(msg.agent)
+        if (msg.model) local.model.set(msg.model)
+        if (msg.variant) local.model.variant.set(msg.variant)
       }
-      if (msg.model) local.model.set(msg.model)
-      if (msg.variant) local.model.variant.set(msg.variant)
     }
   })