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

This commit is contained in:
asepharyana committed 2026-09-03 16:13:29 +07:00
1 parent f5b04214cf
commit 93e5464370
7 files changed
+174 -15

No files matched your search

+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);
}