Skip to content

fix(cli): update TUI status bar model name on provider fallback - #6399

Closed
SeeYangZhi wants to merge 1 commit into
NousResearch:mainfrom
SeeYangZhi:fix/tui-status-bar-model-name-on-fallback
Closed

fix(cli): update TUI status bar model name on provider fallback#6399
SeeYangZhi wants to merge 1 commit into
NousResearch:mainfrom
SeeYangZhi:fix/tui-status-bar-model-name-on-fallback

Conversation

@SeeYangZhi

Copy link
Copy Markdown
Contributor

Summary

  • Read model name from agent.model (live, updated by _try_activate_fallback()) instead of self.model (stale CLI attribute set once at init)
  • Remove redundant getattr(self, "agent") call already done earlier in the method

Fixes #6398

Problem

When provider fallback activates, the TUI status bar shows the original model name while context_length_max correctly updates to the fallback model's limit — a confusing mismatch.

self.model on the CLI class is set once during __init__ and never updated mid-session. _try_activate_fallback() in run_agent.py swaps agent.model but the CLI never sees it.

The status bar reads self.model from the CLI class, which is set once
at init and never updated when _try_activate_fallback() switches to a
backup provider/model in run_agent.py. This causes the TUI to display
the original model name while context_length_max changes, creating a
confusing mismatch.

Read the model name from agent.model (live, updated by fallback) with
self.model as fallback before the agent is created. Remove the
redundant getattr(self, 'agent') call that was already done above.
@teknium1

teknium1 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Merged via salvage PR #6754. Your commit cherry-picked onto current main with authorship preserved. Thank you @SeeYangZhi!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI status bar shows stale model name after fallback activation

2 participants