fix: /status shows stale thinking level after directive change#16700
Open
cmfinlan wants to merge 5 commits intoopenclaw:mainfrom
Open
fix: /status shows stale thinking level after directive change#16700cmfinlan wants to merge 5 commits intoopenclaw:mainfrom
cmfinlan wants to merge 5 commits intoopenclaw:mainfrom
Conversation
| reasoningLevel: "medium", | ||
| }, | ||
| sessionKey: "agent:main:main", | ||
| sessionScope: "per-sender", |
Contributor
There was a problem hiding this comment.
Invalid ReasoningLevel value in test
ReasoningLevel is defined as "off" | "on" | "stream", but this test uses "medium" which is not a valid value. The test still passes because SessionEntry.reasoningLevel is typed as string | undefined, but using an invalid value here weakens the test's fidelity — it's testing a scenario that shouldn't occur in practice. Consider using "on" or "stream" instead.
Suggested change
| sessionScope: "per-sender", | |
| reasoningLevel: "on", |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/auto-reply/status.test.ts
Line: 129:129
Comment:
**Invalid `ReasoningLevel` value in test**
`ReasoningLevel` is defined as `"off" | "on" | "stream"`, but this test uses `"medium"` which is not a valid value. The test still passes because `SessionEntry.reasoningLevel` is typed as `string | undefined`, but using an invalid value here weakens the test's fidelity — it's testing a scenario that shouldn't occur in practice. Consider using `"on"` or `"stream"` instead.
```suggestion
reasoningLevel: "on",
```
How can I resolve this? If you propose a fix, please make it concise.bfc1ccb to
f92900f
Compare
added 3 commits
February 15, 2026 13:48
…sion entry The `buildStatusMessage` function had an inconsistency: it checked `sessionEntry.elevatedLevel` as a fallback but did NOT check `sessionEntry.thinkingLevel`, `sessionEntry.verboseLevel`, or `sessionEntry.reasoningLevel`. This caused the `session_status` tool (and any other caller that omits the pre-resolved values) to show the config default instead of the session's actual thinking level. Changes: - `buildStatusMessage` (status.ts): Add sessionEntry fallback for thinkLevel, verboseLevel, and reasoningLevel — matching the existing elevatedLevel pattern. - `session_status` tool (session-status-tool.ts): Explicitly resolve and pass resolvedThink/Verbose/Reasoning/Elevated to buildStatusMessage, mirroring the resolution chain used by the runtime header builder. - Add 5 regression tests covering the fallback chain priority. Fixes openclaw#10867
…law#10867) When /think X /status are sent together as a directive-only message, buildStatusReply received the pre-directive resolvedDefaultThinkLevel which was computed before handleDirectiveOnly mutated sessionEntry. Re-resolve all directive levels from sessionEntry after handleDirectiveOnly runs so the status reply reflects the just-applied changes. Also re-resolve verbose, reasoning, and elevated levels for consistency. Closes openclaw#10867
ReasoningLevel type is 'off' | 'on' | 'stream', not ThinkLevel. Addresses Greptile review comment on status.test.ts:129.
be52090 to
8ce32fb
Compare
This was referenced Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
/think high /status(or any/think X /statuscombo) is sent as a directive-only message, theThink:field in the status reply shows the old thinking level rather than the just-applied one.Root cause
In
get-reply-directives-apply.ts,resolvedDefaultThinkLevelis computed beforehandleDirectiveOnlyruns.handleDirectiveOnlymutatessessionEntry.thinkingLevelto the new value, but the status reply still receives the stale pre-directive value.Fix
After
handleDirectiveOnlyreturns, re-resolve all directive levels fromsessionEntrybefore passing them tobuildStatusReply. This ensures the status output reflects the just-applied changes.The same pattern is applied to verbose, reasoning, and elevated levels for consistency.
Tests
Added two regression tests to
status.test.ts:resolvedThinkmatching the updatedsessionEntry.thinkingLevelshows correctlysessionEntry.thinkingLevelfallback works whenresolvedThinkis omittedAll 28 tests pass.
Closes #10867
Greptile Summary
Fixes a stale status display bug where
/think high /status(or any/directive /statuscombo) showed the old thinking level instead of the just-applied one. The fix re-resolves all directive levels (thinkingLevel,verboseLevel,reasoningLevel,elevatedLevel) fromsessionEntryafterhandleDirectiveOnlymutates them, ensuring the status output reflects the current state.Key changes:
get-reply-directives-apply.ts: Re-reads directive levels fromsessionEntryafterhandleDirectiveOnlycompletes before passing tobuildStatusReplystatus.ts: Updated fallback chain to checksessionEntrylevels whenresolved*params are omittedsession-status-tool.ts: Now explicitly resolves and passes all directive levels tobuildStatusMessagegateway-lock.test.tsswitched from fake timers to real timers to avoid intermittent CI hangsConfidence Score: 5/5
Last reviewed commit: 1516698