fix(coding-agent): preserve session thinking for scoped model cycling

closes #1789
This commit is contained in:
Mario Zechner 2026-03-04 19:51:55 +01:00
parent 4cb1a56b53
commit e64cd15c25
6 changed files with 22 additions and 17 deletions

View file

@ -23,7 +23,7 @@ interface ModelItem {
interface ScopedModelItem {
model: Model<any>;
thinkingLevel: string;
thinkingLevel?: string;
}
type ModelScope = "all" | "scoped";

View file

@ -3307,13 +3307,11 @@ export class InteractiveMode {
// Helper to update session's scoped models (session-only, no persist)
const updateSessionModels = async (enabledIds: Set<string>) => {
if (enabledIds.size > 0 && enabledIds.size < allModels.length) {
// Use current session thinking level, not settings default
const currentThinkingLevel = this.session.thinkingLevel;
const newScopedModels = await resolveModelScope(Array.from(enabledIds), this.session.modelRegistry);
this.session.setScopedModels(
newScopedModels.map((sm) => ({
model: sm.model,
thinkingLevel: sm.thinkingLevel ?? currentThinkingLevel,
thinkingLevel: sm.thinkingLevel,
})),
);
} else {