#23279: fix: show correct context limit in status when runtime model differs
commands
size: S
Cluster:
Context Window Fixes
Fixes https://github.com/openclaw/openclaw/issues/23122
Changes the lookup behavior to respect runtime model overrides when displaying context length in `session_status` output.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Fixed context window display in `openclaw status` to show the correct limit when a session uses a runtime model override. The bug occurred because the code was falling back to the config-level default model when looking up context tokens, even when the session had a different runtime model. The fix ensures `lookupContextTokens` is called with the session's actual runtime model, not the fallback default.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The fix is surgical and well-tested: it corrects a display bug by ensuring context token lookups use the actual runtime model instead of falling back to config defaults. The new test validates the exact scenario from issue #23122, and the logic change is minimal with no side effects.
- No files require special attention
<sub>Last reviewed commit: a8ac19b</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#23299: fix(status): show runtime model context limit instead of stale sess...
by SidQin-cyber · 2026-02-22
86.1%
#18721: fix: prefer configured contextTokens over model catalog in status d...
by MisterGuy420 · 2026-02-17
78.6%
#17414: fix(sessions): refresh contextTokens when model override changes
by michaelbship · 2026-02-15
78.0%
#17015: fix: correct Claude 4.5 context limits in model registry
by Limitless2023 · 2026-02-15
77.4%
#15726: fix(sessions): use model contextWindow instead of agent contextToke...
by lailoo · 2026-02-13
77.3%
#13940: fix: suppress low context window warning for explicitly configured ...
by tsukhani · 2026-02-11
77.3%
#17647: fix: Display error messages instead of (no output) for non-Claude m...
by MisterGuy420 · 2026-02-16
76.9%
#12220: fix: forward-compat models now respect user-configured contextWindow
by Batuhan4 · 2026-02-09
76.8%
#17604: fix(context): use getAvailable() to prevent cross-provider model ID...
by aldoeliacim · 2026-02-16
76.6%
#6053: fix: use 400K context window instead of 200K if the model allows (g...
by icedac · 2026-02-01
76.5%