fix(tui): resolve wrong provider prefix when session has model without modelProvider#25874
Merged
gumadeiras merged 7 commits intoopenclaw:mainfrom Feb 25, 2026
Conversation
86bbc93 to
ff6b44c
Compare
ff6b44c to
4c197fd
Compare
fa1d1df to
91449c8
Compare
…rovider cross-contamination When a session is reset (via /new or /reset), the previous entry's model field was copied to the new entry but modelProvider was not. This left the new entry in a state where resolveSessionModelRef would fall back to the config default_model provider (e.g. google-gemini-cli) when the stored model string has no provider prefix — producing a wrong display like 'google-gemini-cli/claude-sonnet-4-6' in the TUI status bar. Fixes the root cause for issue openclaw#25408 alongside the defensive fix in session-utils.ts.
This reverts commit 0da3cd2f18c70fbb1ff045f183cae1beeb291bbb.
aade9d3 to
f0953a7
Compare
Member
Jackson3195
pushed a commit
to Jackson3195/openclaw-with-a-personal-touch
that referenced
this pull request
Feb 25, 2026
…t modelProvider (openclaw#25874) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f0953a7 Co-authored-by: lbo728 <72309817+lbo728@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
kevinWangSheng
pushed a commit
to kevinWangSheng/openclaw
that referenced
this pull request
Feb 26, 2026
…t modelProvider (openclaw#25874) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f0953a7 Co-authored-by: lbo728 <72309817+lbo728@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
kevinWangSheng
pushed a commit
to kevinWangSheng/openclaw
that referenced
this pull request
Feb 26, 2026
…t modelProvider (openclaw#25874) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f0953a7 Co-authored-by: lbo728 <72309817+lbo728@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
2 tasks
execute008
pushed a commit
to execute008/openclaw
that referenced
this pull request
Feb 27, 2026
…t modelProvider (openclaw#25874) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f0953a7 Co-authored-by: lbo728 <72309817+lbo728@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
r4jiv007
pushed a commit
to r4jiv007/openclaw
that referenced
this pull request
Feb 28, 2026
…t modelProvider (openclaw#25874) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f0953a7 Co-authored-by: lbo728 <72309817+lbo728@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
steipete
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
…t modelProvider (openclaw#25874) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f0953a7 Co-authored-by: lbo728 <72309817+lbo728@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…t modelProvider (openclaw#25874) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f0953a7 Co-authored-by: lbo728 <72309817+lbo728@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
thebenjaminlee
pushed a commit
to escape-velocity-ventures/openclaw
that referenced
this pull request
Mar 7, 2026
…t modelProvider (openclaw#25874) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f0953a7 Co-authored-by: lbo728 <72309817+lbo728@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
lovewanwan
pushed a commit
to lovewanwan/openclaw
that referenced
this pull request
Apr 28, 2026
…t modelProvider (openclaw#25874) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f0953a7 Co-authored-by: lbo728 <72309817+lbo728@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
ogt-redknie
pushed a commit
to ogt-redknie/OPENX
that referenced
this pull request
May 2, 2026
…t modelProvider (openclaw#25874) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f0953a7 Co-authored-by: lbo728 <72309817+lbo728@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
May 9, 2026
…t modelProvider (openclaw#25874) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f0953a7 Co-authored-by: lbo728 <72309817+lbo728@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #25408
When a session was reset (via
/newor/reset), the TUI status bar could display a wrong provider prefix — e.g.google-gemini-cli/claude-sonnet-4-6instead ofanthropic/claude-sonnet-4-6.Root cause (two-part):
Missing
modelProvidercopy on session reset (src/gateway/server-methods/sessions.ts):sessions.resetcopied the previous entry'smodelfield to the new entry but did not copymodelProvider. This left the new entry withmodelProvider = null.Wrong fallback in
resolveSessionModelRef(src/gateway/session-utils.ts): WhenruntimeProvideris null and the storedruntimeModelhas no/separator (e.g."claude-sonnet-4-6"), the code usedprovider || DEFAULT_PROVIDERas the fallback. Hereproviderwas resolved from the config'sdefault_model(e.g.google-gemini-cli), producing the wrong prefix.Fix
1. Copy
modelProvideron session reset2. Defensive fallback in
resolveSessionModelRefWhen the stored model string contains no provider prefix (
/), fall back toDEFAULT_PROVIDER("anthropic") rather than the config default_model's provider — a bare model name likeclaude-sonnet-4-6is always an Anthropic model:Testing
Two new tests added to
src/gateway/session-utils.test.ts:/) with a non-Anthropic config default → usesDEFAULT_PROVIDERanthropic/claude-sonnet-4-6) → provider parsed from the string itselfAll 97 test files pass.
Greptile Summary
Fixed TUI status bar displaying wrong provider prefix after session reset by ensuring
modelProvideris preserved during reset and implementing defensive fallback logic for legacy sessions. The changes prevent cross-contamination between config defaults and session state (e.g., preventinggoogle-gemini-cli/claude-sonnet-4-6when it should beanthropic/claude-sonnet-4-6).Confidence Score: 5/5
Last reviewed commit: 86bbc93