core: guard /model writes while agent is running

This commit is contained in:
Levi Neely 2026-04-13 13:34:13 +02:00
parent adb4b3c46f
commit dace96ce5b
1 changed files with 4 additions and 0 deletions

View File

@ -729,6 +729,10 @@ func (s *agentCore) handleCommand(ctx context.Context, input string, handler Eve
handler(infoEvent(s.loopcfg.Backend.Model()))
return true
}
if s.IsRunning() {
handler(infoEvent("error: cannot switch model while agent is running"))
return true
}
s.loopcfg.Backend.SetModel(args[0])
handler(infoEvent("switched model to: " + args[0]))
return true