#17011: fix(/new /reset): clear model override for reset turn
stale
size: XS
Cluster:
Session Management Improvements
Fixes #17003
## Problem
When using /new or /reset, the welcome message shows the previous session's model instead of the default model.
## Root Cause
Model override was NOT being explicitly cleared when resetTriggered=true, causing the reset turn to inherit the old model for selection.
## Solution
Explicitly set persistedModelOverride and persistedProviderOverride to undefined when reset is triggered, ensuring the turn uses default model selection.
## Result
Welcome message now correctly shows the default model after /new or /reset.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds explicit `undefined` assignments for `persistedModelOverride` and `persistedProviderOverride` inside the `resetTriggered` branch of `initSessionState`, with the intent of ensuring model/provider overrides are not carried over on `/new` or `/reset`.
- The change is a **defensive clarification** — analysis of the control flow confirms that these variables are already `undefined` at this point (initialized as `undefined` on lines 141-142, and the only branch that assigns them non-`undefined` values at lines 238-239 is guarded by `!isNewSession`, which is `false` when `resetTriggered` is `true`). Additionally, `baseEntry` is `undefined` when `isNewSession=true`, so the `??` fallback on lines 290-291 also stays `undefined`.
- The comment update on line 248 accurately documents the intent: behavior overrides (verbose, thinking, reasoning, ttsAuto) are preserved across resets, but model/provider overrides are not.
- No functional bugs or regressions introduced.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge — the assignments are functionally redundant and introduce no behavioral change or risk.
- The change adds two explicit `undefined` assignments that are already no-ops given the existing control flow. No new logic, no changed behavior, no risk of regression. The only file touched is `session.ts` with a minimal, well-scoped diff.
- No files require special attention.
<sub>Last reviewed commit: 280675f</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#21849: fix(session): clear model/provider overrides on /new and /reset
by widingmarcus-cyber · 2026-02-20
87.2%
#21876: fix(session): clear model override on /new and /reset
by sauerdaniel · 2026-02-20
86.8%
#21847: fix(session): /new and /reset no longer carry over model overrides
by hydro13 · 2026-02-20
86.7%
#17375: fix(session): don't carry stale model info into reset welcome message
by BinHPdev · 2026-02-15
85.3%
#20185: fix(model): recognize default/reset/clear keywords to clear session...
by yxshee · 2026-02-18
84.0%
#11613: fix: clear stale model metadata on /new and /reset
by mcaxtr · 2026-02-08
83.8%
#21731: Fix: clear stale session runtime model on /new, /reset, and session...
by AIflow-Labs · 2026-02-20
83.2%
#14358: fix: preserve session overrides (verbose, model) across /new or /rese…
by WyattSanders · 2026-02-12
82.7%
#10186: fix: clear model/provider override when /new starts a fresh session
by Yida-Dev · 2026-02-06
80.3%
#19087: fix(sessions): sync display fields on model switch
by Suksham-sharma · 2026-02-17
78.4%