diff --git a/packages/coding-agent/src/modes/interactive-mode.ts b/packages/coding-agent/src/modes/interactive-mode.ts index 383217c15..508157328 100644 --- a/packages/coding-agent/src/modes/interactive-mode.ts +++ b/packages/coding-agent/src/modes/interactive-mode.ts @@ -2040,16 +2040,20 @@ export class InteractiveMode implements InteractiveModeContext { : "Approve and keep context"; // Model-tier slider: let the operator pick which configured role model - // (smol/default/slow/…) executes the approved plan. Left/right move it from - // any list position. Hidden when fewer than two role models resolve — a lone - // tier is no choice. `selectedTierIndex` tracks the live slider position. + // (smol/default/slow/…) executes the approved plan. The slider always starts + // on the `default` tier so execution defaults to the default model no matter + // which model drove the planning conversation. Left/right move it from there; + // hidden when fewer than two role models resolve — a lone tier is no choice. + // `selectedTierIndex` tracks the live slider position. const cycle = this.session.getRoleModelCycle(this.session.settings.get("cycleOrder")); - let selectedTierIndex = cycle?.currentIndex ?? 0; + const defaultTierIndex = cycle ? cycle.models.findIndex(entry => entry.role === "default") : -1; + const startTierIndex = defaultTierIndex >= 0 ? defaultTierIndex : (cycle?.currentIndex ?? 0); + let selectedTierIndex = startTierIndex; const slider: HookSelectorSlider | undefined = cycle && cycle.models.length > 1 ? { caption: "continue with", - index: cycle.currentIndex, + index: startTierIndex, segments: cycle.models.map(entry => ({ label: entry.role, color: MODEL_ROLES[entry.role as ModelRole]?.color, @@ -2086,6 +2090,9 @@ export class InteractiveMode implements InteractiveModeContext { // applying the slider choice any earlier would be silently reverted — // the bug that made "continue with slow" keep executing on the default // model. Deferred application also survives newSession()/compaction. + // `cycle.currentIndex` is exactly that restored model, so any chosen tier + // differing from it needs an explicit executionModel — this also covers + // leaving the slider on its `default` anchor while planning ran elsewhere. const executionModel = cycle && selectedTierIndex !== cycle.currentIndex ? cycle.models[selectedTierIndex] : undefined; await this.#approvePlan(latestPlanContent, {