← Back to PRs

#10998: fix(agents): pass session thinking/reasoning levels to session_status display

by wony2 open 2026-02-07 08:12 View on GitHub →
agents stale size: S
## Summary Closes #10867. The `session_status` tool now reads per-session thinking/reasoning/verbose/elevated levels from the session entry instead of always falling back to agent defaults. lobster-biscuit ## Problem After running `/reasoning medium`, the `session_status` tool displays "Think: off" instead of "Think: medium". The levels are correctly stored in the session entry but never passed to `buildStatusMessage()`. ## Root Cause `session-status-tool.ts` calls `buildStatusMessage()` without the `resolvedThink`, `resolvedVerbose`, `resolvedReasoning`, or `resolvedElevated` parameters. The function falls back to `args.agent?.thinkingDefault ?? "off"`, ignoring per-session overrides stored in `sessionEntry.thinkingLevel` etc. ## Solution / Behavior Changes - Read `thinkingLevel`, `verboseLevel`, `reasoningLevel`, `elevatedLevel` from the session entry - Normalize them via existing `normalizeThinkLevel()` etc. from `thinking.ts` - Pass as `resolvedThink`/`resolvedVerbose`/`resolvedReasoning`/`resolvedElevated` to `buildStatusMessage()` - When no per-session level is set, behavior is unchanged (falls back to agent defaults) ## Codebase and GitHub Search - `buildStatusMessage` already accepts `resolvedThink`/`resolvedVerbose`/`resolvedReasoning`/ `resolvedElevated` (status.ts:62-65) — just not being passed from the tool - The auto-reply path (`runEmbeddedAttempt`) correctly passes these params; only the `session_status` tool path was missing them - No other callers of `buildStatusMessage` are affected ## Testing - [x] `pnpm build` passed - [x] `pnpm lint` passed - [x] `pnpm check` passed - [x] `pnpm test` passed (full suite — 219 tests) - [x] New test: session entry with `thinkingLevel: "medium"` → status contains "medium" - [x] New test: session entry without levels → falls back to defaults **Sign-Off** - Models used: Claude Opus 4.6 - Submitter effort: verified fix + tests locally - Agent notes: 1-file fix reusing existing normalize functions; no new dependencies <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> - Updates the `session_status` tool to read per-session thinking/verbose/reasoning/elevated levels from the session entry and pass them through to `buildStatusMessage()`. - Reuses existing normalizers (`normalizeThinkLevel`, etc.) to keep level strings consistent with other codepaths. - Adds regression tests to ensure session-level `thinkingLevel` is reflected in the status output and that default behavior still returns a status text when no overrides are present. <h3>Confidence Score: 3/5</h3> - This PR is mostly safe to merge, but there is a functional inconsistency around reasoning-level precedence that should be fixed to match the stated behavior. - The change is small and well-scoped, and tests cover the main regression for thinking. However, `buildStatusMessage()` does not consider `sessionEntry.reasoningLevel` unless callers explicitly pass `resolvedReasoning`, which contradicts the PR’s stated behavior and can cause incorrect status output in other call sites. - src/auto-reply/status.ts <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs