feat(tui): implement live model fetching and enhance model selection menus

This commit is contained in:
asepharyana
2026-09-03 16:13:29 +07:00
parent f5b04214cf
commit 93e5464370
7 changed files with 174 additions and 15 deletions
+11
View File
@@ -165,5 +165,16 @@ export async function runTui(): Promise<void> {
sessionId: state.sessionId,
} as Record<string, unknown>;
// Prime the /models list in the background so /model shows live models
// instead of a hardcoded catalog; the menu falls back until it lands.
if (runtime.listModels) {
void runtime.listModels().then((models) => {
if (models.length > 0) {
state.misc.availableModels = models;
state.dirty = true;
}
});
}
await bootTui(state);
}