From 310344b6e438e7ee50523cf7fa23a5b488a21fca Mon Sep 17 00:00:00 2001 From: YuzuruS Date: Sun, 1 Mar 2026 08:14:00 +0900 Subject: [PATCH] fix: read thinking/verbose/reasoning levels from session entry in status buildStatusMessage resolved thinkLevel, verboseLevel, and reasoningLevel without falling back to sessionEntry, unlike elevatedLevel which already had this fallback. When session_status tool calls buildStatusMessage without passing resolvedThink/resolvedVerbose/resolvedReasoning, the levels always fell back to agent defaults or "off", ignoring the runtime-set session values. Add sessionEntry fallback for thinkingLevel, verboseLevel, and reasoningLevel, consistent with how elevatedLevel already works. Closes #30126 Co-Authored-By: Claude Opus 4.6 --- src/auto-reply/status.test.ts | 22 ++++++++++++++++++++++ src/auto-reply/status.ts | 8 +++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/auto-reply/status.test.ts b/src/auto-reply/status.test.ts index 78d2ba29b..0f58159ff 100644 --- a/src/auto-reply/status.test.ts +++ b/src/auto-reply/status.test.ts @@ -90,6 +90,28 @@ describe("buildStatusMessage", () => { expect(normalized).toContain("Queue: collect"); }); + it("falls back to sessionEntry levels when resolved levels are not passed", () => { + const text = buildStatusMessage({ + agent: { + model: "anthropic/pi:opus", + }, + sessionEntry: { + sessionId: "abc", + updatedAt: 0, + thinkingLevel: "high", + verboseLevel: "full", + reasoningLevel: "on", + }, + sessionKey: "agent:main:main", + queue: { mode: "collect", depth: 0 }, + }); + const normalized = normalizeTestText(text); + + expect(normalized).toContain("Think: high"); + expect(normalized).toContain("verbose:full"); + expect(normalized).toContain("Reasoning: on"); + }); + it("notes channel model overrides in status output", () => { const text = buildStatusMessage({ config: { diff --git a/src/auto-reply/status.ts b/src/auto-reply/status.ts index 46c67fa63..a08931b1c 100644 --- a/src/auto-reply/status.ts +++ b/src/auto-reply/status.ts @@ -506,9 +506,11 @@ export function buildStatusMessage(args: StatusArgs): string { } } - const thinkLevel = args.resolvedThink ?? args.agent?.thinkingDefault ?? "off"; - const verboseLevel = args.resolvedVerbose ?? args.agent?.verboseDefault ?? "off"; - const reasoningLevel = args.resolvedReasoning ?? "off"; + const thinkLevel = + args.resolvedThink ?? args.sessionEntry?.thinkingLevel ?? args.agent?.thinkingDefault ?? "off"; + const verboseLevel = + args.resolvedVerbose ?? args.sessionEntry?.verboseLevel ?? args.agent?.verboseDefault ?? "off"; + const reasoningLevel = args.resolvedReasoning ?? args.sessionEntry?.reasoningLevel ?? "off"; const elevatedLevel = args.resolvedElevated ?? args.sessionEntry?.elevatedLevel ??