diff --git a/src/auto-reply/reply/directive-handling.impl.ts b/src/auto-reply/reply/directive-handling.impl.ts index 463cb42d67..4b07073272 100644 --- a/src/auto-reply/reply/directive-handling.impl.ts +++ b/src/auto-reply/reply/directive-handling.impl.ts @@ -309,11 +309,7 @@ export async function handleDirectiveOnly(params: { let reasoningChanged = directives.hasReasoningDirective && directives.reasoningLevel !== undefined; if (directives.hasThinkDirective && directives.thinkLevel) { - if (directives.thinkLevel === "off") { - delete sessionEntry.thinkingLevel; - } else { - sessionEntry.thinkingLevel = directives.thinkLevel; - } + sessionEntry.thinkingLevel = directives.thinkLevel; } if (shouldDowngradeXHigh) { sessionEntry.thinkingLevel = "high"; diff --git a/src/auto-reply/reply/directive-handling.persist.ts b/src/auto-reply/reply/directive-handling.persist.ts index 0e700238b3..225cae0814 100644 --- a/src/auto-reply/reply/directive-handling.persist.ts +++ b/src/auto-reply/reply/directive-handling.persist.ts @@ -82,11 +82,7 @@ export async function persistInlineDirectives(params: { let updated = false; if (directives.hasThinkDirective && directives.thinkLevel) { - if (directives.thinkLevel === "off") { - delete sessionEntry.thinkingLevel; - } else { - sessionEntry.thinkingLevel = directives.thinkLevel; - } + sessionEntry.thinkingLevel = directives.thinkLevel; updated = true; } if (directives.hasVerboseDirective && directives.verboseLevel) { diff --git a/src/commands/agent.ts b/src/commands/agent.ts index 4c08d75df6..023ca94b46 100644 --- a/src/commands/agent.ts +++ b/src/commands/agent.ts @@ -222,11 +222,7 @@ export async function agentCommand( sessionEntry ?? { sessionId, updatedAt: Date.now() }; const next: SessionEntry = { ...entry, sessionId, updatedAt: Date.now() }; if (thinkOverride) { - if (thinkOverride === "off") { - delete next.thinkingLevel; - } else { - next.thinkingLevel = thinkOverride; - } + next.thinkingLevel = thinkOverride; } applyVerboseOverride(next, verboseOverride); sessionStore[sessionKey] = next; diff --git a/src/gateway/sessions-patch.ts b/src/gateway/sessions-patch.ts index ba2d7bbc03..c5240b5d17 100644 --- a/src/gateway/sessions-patch.ts +++ b/src/gateway/sessions-patch.ts @@ -124,6 +124,7 @@ export async function applySessionsPatchToStore(params: { if ("thinkingLevel" in patch) { const raw = patch.thinkingLevel; if (raw === null) { + // Clear the override and fall back to model default delete next.thinkingLevel; } else if (raw !== undefined) { const normalized = normalizeThinkLevel(String(raw)); @@ -134,11 +135,7 @@ export async function applySessionsPatchToStore(params: { `invalid thinkingLevel (use ${formatThinkingLevels(hintProvider, hintModel, "|")})`, ); } - if (normalized === "off") { - delete next.thinkingLevel; - } else { - next.thinkingLevel = normalized; - } + next.thinkingLevel = normalized; } }