Skip to content

fix(chat): restore default reasoning after off - #1255

Merged
shanselman merged 1 commit into
mainfrom
shanselman-restore-reasoning-effort-after-off
Aug 28, 2026
Merged

shanselman merged 1 commit into
mainfrom
shanselman-restore-reasoning-effort-after-off

Conversation

@shanselman

Copy link
Copy Markdown
Collaborator

Fixes #980

Adds a clearly labeled Default reasoning entry to the native chat composer. Selecting it clears the session thinkingLevel through the existing SessionPatch.Clear explicit-null contract instead of substituting a concrete level.

The clear operation is typed through the composer, controller, runtime port, provider, and gateway bridge boundaries. Model and thinking-level session option patches are serialized per session, and the next send waits for the pending patch so the first prompt after restoring Default cannot race the clear.

Concrete reasoning levels still pass through unchanged. Gateway errors and Copilot model metadata behavior are unchanged.

Validation

  • ./build.ps1: passed
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: passed, 3,819 passed, 32 skipped
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore --filter "FullyQualifiedName!~BrowserProxyEndpointScopingTests": passed, 2,733 passed
  • dotnet test ./tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj --no-restore: passed, 1,010 passed
  • python .agents/skills/autoreview/scripts/autoreview --mode local: clean, no accepted or actionable findings
  • Final rubber-duck review: no issues

The unfiltered Tray run passed 2,276 tests, then the test host hung while BrowserProxyEndpointScopingTests.Diagnostics_NoOverride_TunnelWithoutBrowserProxyForward_DoesNotProbeTunnelLocalPlusTwo was active. Running that unrelated class alone also hung on this host in PortDiagnosticsService.GetActiveTcpListeners. The remaining 2,733 Tray tests passed in an isolated data directory.

Real behavior proof

  • ClearThinkingLevel_FromOff_DelegatesExplicitClearNotConcreteLevel proves an off session routes Default to the dedicated clear operation and does not send a concrete level.
  • SessionPatch_ToPayload_ClearSerializesToJsonNull proves the wire payload contains "thinkingLevel":null.
  • SendMessageAsync_WaitsForInFlightThinkingLevelClearBeforeGatewaySend proves the next message waits until the Default clear completes.
  • Concrete-level tests prove high still reaches the Gateway bridge unchanged.

UI proof: Not verified / blocked. The current branch app launched successfully with ./run-app-local.ps1 -NoBuild -AllowNonMain, and the chat deep link opened the current-head native chat surface. The composer could not render because the existing Gateway connection failed with SSH tunnel failed: TCP listener ownership could not be verified. No Gateway settings or model metadata were changed to work around that truthful runtime error.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@shanselman shanselman added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Aug 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. labels Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 28, 2026, 3:42 AM ET / 07:42 UTC.

ClawSweeper review

What this changes

The PR adds a Default reasoning choice in native chat that clears a session’s explicit reasoning override and serializes the update before the next message is sent.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. This collaborator-authored, actively landing PR provides a focused fix for the linked native chat recovery path; manual source review found no blocking defect, and CI should finish its normal gate.

Priority: P2
Reviewed head: efda8127dfcc1dfa17f093e16d02af358d71d460

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable: the author is a collaborator, so the external-contributor real-behavior-proof gate does not apply; the supplied body nevertheless records focused current-head validation and an explicit native-UI gateway blocker.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable: the author is a collaborator, so the external-contributor real-behavior-proof gate does not apply; the supplied body nevertheless records focused current-head validation and an explicit native-UI gateway blocker.
Evidence reviewed 6 items Verified PR introduction: The host-verified merge-base delta shows this branch introduces the Default reasoning picker, dedicated clear operation, and focused test coverage.
Explicit-null gateway contract: The established session-patch serializer emits an explicit JSON null for a cleared ThinkingLevel, distinct from omitting or setting a string value.
Clear and send ordering: The introduced bridge maps Default to SessionPatch.Clear, while the provider serializes session-option patches and waits before sending.
Findings None None.
Security None None.

Live Verification

Command: dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --filter "FullyQualifiedName~OpenClawChatDataProviderTests"

Result: FAIL (failed) — execution before step 1 expect_output: sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.24.0.tgz | [ERR_PNPM_NO_LOCKFILE] Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"

sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.24.0.tgz | [ERR_PNPM_NO_LOCKFILE] Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"

Assertions:

  • FAIL expect_output: Passed!

How this fits together

The native chat composer shows the gateway session’s model and reasoning state, then routes picker changes through the chat provider to a gateway session patch. The provider also controls whether an outgoing message waits for an in-flight session-option update.

flowchart LR
A[Gateway session state] --> B[Native chat composer]
B --> C[Reasoning picker]
C --> D[Chat provider]
D --> E[Session patch request]
D --> F[Outgoing chat message]
E --> F
Loading

Before merge

  • Add real behavior proof - Not applicable: Not applicable: the author is a collaborator, so the external-contributor real-behavior-proof gate does not apply; the supplied body nevertheless records focused current-head validation and an explicit native-UI gateway blocker.
  • Resolve merge risk (P1) - The native UI path was blocked by an existing gateway tunnel diagnostic in the supplied proof, and the optional structured review helper could not create a temporary directory; pending CI and a later isolated UI check remain useful confidence signals.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Code and regression coverage production +91/-27, tests +101/-3 across 15 files The added implementation is paired with payload, controller, provider, and ordering coverage for the new recovery action.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #980
Summary: This PR is a concrete candidate fix for the linked reasoning-override recovery issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused explicit-null clear path after normal CI completes, preserving Default as distinct from every gateway-accepted concrete reasoning value.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the focused explicit-null clear path after normal CI completes, preserving Default as distinct from every gateway-accepted concrete reasoning value.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level. The base composer offered only concrete reasoning values, including off, while the linked report supplies the affected provider/model scenario; the PR adds the previously absent explicit-clear path.

Is this the best way to solve the issue?

Yes. Reusing the existing tri-state SessionPatch clear contract restores the gateway default without guessing a concrete reasoning level that the provider may reject.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1955282412bd.

Labels

Label changes:

  • add P2: This repairs a bounded native-chat session recovery path without evidence of an emergency or broad availability impact.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • add status: needs maintainer proof decision: A ClawSweeper-authored PR needs a maintainer proof capture or override decision. Not applicable: Not applicable: the author is a collaborator, so the external-contributor real-behavior-proof gate does not apply; the supplied body nevertheless records focused current-head validation and an explicit native-UI gateway blocker.

Label justifications:

  • P2: This repairs a bounded native-chat session recovery path without evidence of an emergency or broad availability impact.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: needs maintainer proof decision: A ClawSweeper-authored PR needs a maintainer proof capture or override decision. Not applicable: Not applicable: the author is a collaborator, so the external-contributor real-behavior-proof gate does not apply; the supplied body nevertheless records focused current-head validation and an explicit native-UI gateway blocker.

Evidence

What I checked:

Likely related people:

  • Barbara Kudiess: Introduced the current Reactor-based composer ownership boundary that this PR extends. (role: composer feature introducer; confidence: high; commits: 686afdc8d4a2; files: src/OpenClaw.Tray.WinUI/Chat/ReactorChatComposer.cs, src/OpenClaw.Tray.WinUI/Chat/ChatComposerController.cs)
  • Caleb Eden: Has recent merged maintenance history in the gateway-backed chat provider and adjacent native-chat behavior. (role: recent chat-provider contributor; confidence: high; commits: a76c85218c7d, 2fb1da26c175; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@shanselman shanselman removed the status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. label Aug 28, 2026
@shanselman
shanselman merged commit a1d7cb0 into main Aug 28, 2026
24 checks passed
@shanselman
shanselman deleted the shanselman-restore-reasoning-effort-after-off branch August 28, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reasoning effort can't be restored after selecting "off" on Claude Opus 4.7 (gateway rejects every non-off level with "use off")

1 participant