Fix TUI footer to show the actual model you're using

When you switch models via /models, the footer was still showing the old provider name instead of updating to show what you just selected. This was confusing because the token stats were live but the model name was stuck on the default.

The issue was that the footer reads from the session list, which only looked at model/modelProvider fields (set after agent runs). When you manually switch models, it actually sets providerOverride/modelOverride instead, so we need to resolve the effective model considering those overrides.

Now calls resolveSessionModelRef() to get the right model name, so the footer immediately reflects what you picked.
This commit is contained in:
Suryaansh 2026-01-28 06:36:22 +05:30
parent afd57c7e23
commit 0c44333cfc

View File

@ -553,6 +553,7 @@ export function listSessionsFromStore(params: {
entry?.label ??
originLabel;
const deliveryFields = normalizeSessionDeliveryFields(entry);
const resolvedModel = resolveSessionModelRef(cfg, entry);
return {
key,
entry,
@ -578,8 +579,8 @@ export function listSessionsFromStore(params: {
outputTokens: entry?.outputTokens,
totalTokens: total,
responseUsage: entry?.responseUsage,
modelProvider: entry?.modelProvider,
model: entry?.model,
modelProvider: resolvedModel.provider,
model: resolvedModel.model,
contextTokens: entry?.contextTokens,
deliveryContext: deliveryFields.deliveryContext,
lastChannel: deliveryFields.lastChannel ?? entry?.lastChannel,