diff --git a/src/auto-reply/reply/get-reply-directives.ts b/src/auto-reply/reply/get-reply-directives.ts index f421ed92eae..ba1b1c0656e 100644 --- a/src/auto-reply/reply/get-reply-directives.ts +++ b/src/auto-reply/reply/get-reply-directives.ts @@ -390,10 +390,14 @@ export async function resolveReplyDirectives(params: { model = modelState.model; // When neither directive nor session set reasoning, default to model capability (e.g. OpenRouter with reasoning: true). + // Skip auto-enabling when thinking is already active — the model's internal + // thinking blocks would otherwise be formatted and delivered as visible + // "Reasoning:" messages, leaking internal content to the user. const reasoningExplicitlySet = directives.reasoningLevel !== undefined || (sessionEntry?.reasoningLevel !== undefined && sessionEntry?.reasoningLevel !== null); - if (!reasoningExplicitlySet && resolvedReasoningLevel === "off") { + const thinkingActive = resolvedThinkLevel !== undefined && resolvedThinkLevel !== "off"; + if (!reasoningExplicitlySet && resolvedReasoningLevel === "off" && !thinkingActive) { resolvedReasoningLevel = await modelState.resolveDefaultReasoningLevel(); }