fix: sync model tier between TUI and WebChat when switching models
ModelRouter now supports multiple tier-change listeners via addOnTierChange(), SessionBridge subscribes to tier changes and propagates them to all WebChat agents (both existing and newly created), and the fullscreen TUI now also updates the agent's tier when switching models (matching minimal TUI behavior).
This commit is contained in:
@@ -191,6 +191,10 @@ export function App({
|
||||
}
|
||||
const tier = resolveModelAlias(command.name);
|
||||
if (modelRouter.setTier(tier)) {
|
||||
// Also update the agent tier so chatWithRouter uses the correct client
|
||||
if (agent) {
|
||||
agent.setModelTier(tier);
|
||||
}
|
||||
setCurrentModel(tier);
|
||||
const successMsg: Message = { role: 'assistant', content: `Switched to model: ${tier}` };
|
||||
const successWithTs = session.addMessage(successMsg);
|
||||
|
||||
Reference in New Issue
Block a user