fix(sessions): copy modelProvider on session reset to prevent stale provider 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 #25408 alongside the defensive fix in
session-utils.ts.
This commit is contained in:
lbo728
2026-02-25 07:55:53 +09:00
committed by Gustavo Madeira Santana
parent d846a28c98
commit c8fce062a5

View File

@@ -387,6 +387,7 @@ export const sessionsHandlers: GatewayRequestHandlers = {
reasoningLevel: entry?.reasoningLevel,
responseUsage: entry?.responseUsage,
model: entry?.model,
modelProvider: entry?.modelProvider,
contextTokens: entry?.contextTokens,
sendPolicy: entry?.sendPolicy,
label: entry?.label,