fix: sync agent tier when /model command switches model

The /model command was only updating the router's currentTier but not
the agent's currentTier. Since NativeAgent.chatWithRouter() passes its
own tier to router.chat(), switching to 'local' still sent requests
through the default (Anthropic) client first.
This commit is contained in:
William Valentin
2026-02-06 10:05:32 -08:00
parent e4b7f96d33
commit f7cc87a4bb
2 changed files with 43 additions and 0 deletions
+4
View File
@@ -213,6 +213,10 @@ export class MinimalTui {
const tier = resolveModelAlias(name);
if (router.setTier(tier)) {
// Also update the agent tier so chatWithRouter uses the correct client
if (this.config.agent) {
this.config.agent.setModelTier(tier);
}
console.log(`${colors.gray}Switched to model:${colors.reset} ${tier}\n`);
} else {
console.log(`${colors.gray}Model not available:${colors.reset} ${name}\n`);