fix: TUI now uses shared model router with auto-fallback support
The TUI was building its own ModelRouter with a duplicated client factory that lacked auto same-model fallback, local_providers resolution, retry config, and per-tier fallback logic. When Anthropic failed, it skipped GitHub Models and fell straight to the local Ollama model. Replace the duplicated ~50-line createClient + router setup in tui.ts with a single call to the daemon's createModelRouter(), which already handles all of these correctly. This removes ~50 lines of duplicated code and ensures TUI and daemon have identical fallback behavior.
This commit is contained in:
+1
-1
@@ -175,7 +175,7 @@ export function createAutoFallbackClient(tierConfig: { provider: string; model:
|
||||
});
|
||||
}
|
||||
|
||||
function createModelRouter(config: Config): ModelRouter {
|
||||
export function createModelRouter(config: Config): ModelRouter {
|
||||
const models = config.models;
|
||||
|
||||
const defaultClient = createClientFromConfig(models.default);
|
||||
|
||||
Reference in New Issue
Block a user