← Back to PRs

#6750: fix(tui): show session model overrides in status bar

by ewijaya open 2026-02-02 01:16 View on GitHub →
gateway
## Problem The TUI status bar was showing the default model (e.g., `anthropic/claude-sonnet-4-5`) instead of session-level model overrides. When using `session_status` or `/model` to change models, the footer wouldn't update to reflect the new model. ## Cause `sessions.list` returned `entry.model` and `entry.modelProvider`, but model overrides are stored in `entry.modelOverride` and `entry.providerOverride`. The TUI's `refreshSessionInfo()` was therefore getting the wrong (non-overridden) model values. ## Solution Make `sessions.list` prefer the override fields when present: ```typescript modelProvider: entry?.providerOverride ?? entry?.modelProvider, model: entry?.modelOverride ?? entry?.model, ``` This allows the TUI footer to correctly display the effective model after session-level model changes. ## Testing After this fix: 1. Run `openclaw` TUI 2. Change model via `/model opus` or agent's `session_status` tool 3. Footer should now show the updated model (e.g., `anthropic/claude-opus-4-5`) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates the gateway’s `sessions.list` mapping so the TUI status bar reflects the *effective* session model after `/model` or `session_status` changes. Specifically, `listSessionsFromStore` now prefers `entry.modelOverride`/`entry.providerOverride` over the base `entry.model`/`entry.modelProvider` when populating `GatewaySessionRow.model` and `.modelProvider`. The change is localized to `src/gateway/session-utils.ts` and aligns the list output with existing “effective model” logic already used elsewhere (e.g., `resolveSessionModelRef`). <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk. - The change is a small, targeted field selection adjustment in `sessions.list` output and matches existing override semantics used in `resolveSessionModelRef`. No control flow changes, no API surface changes beyond returning more accurate values when overrides exist. - No files require special attention <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs