Skip to content

fix(agents): don't auto-enable reasoning when thinking is active (#24290)#24335

Merged
ngutman merged 2 commits intoopenclaw:mainfrom
Kay-051:fix/strip-thinking-blocks-from-delivery
Feb 23, 2026
Merged

fix(agents): don't auto-enable reasoning when thinking is active (#24290)#24335
ngutman merged 2 commits intoopenclaw:mainfrom
Kay-051:fix/strip-thinking-blocks-from-delivery

Conversation

@Kay-051
Copy link
Copy Markdown
Contributor

@Kay-051 Kay-051 commented Feb 23, 2026

Summary

  • Problem: When thinking=low is set, the model produces internal thinking blocks. The reasoning auto-default (based on model capability) was also enabling reasoning delivery, causing thinking blocks to be formatted as "Reasoning:" text and delivered to WhatsApp/Telegram.
  • Why it matters: Users see the model's internal reasoning in their chat messages, prefixed with "Reasoning:" in italics — confusing and leaking internal content.
  • What changed: Skip auto-enabling reasoningLevel when thinkLevel is already set (not "off"). The two features serve the same purpose; enabling both causes the model's internal thinking to be exposed as visible chat messages.
  • What did NOT change: Users who explicitly set /reasoning on still get reasoning output. Only the auto-default is suppressed when thinking is active.

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Gateway / orchestration
  • Integrations

Linked Issue/PR

User-visible / Behavior Changes

With thinking=low/medium/high, thinking blocks are no longer delivered as visible "Reasoning:" messages to WhatsApp/Telegram/other channels. Downgrade to 2026.2.21-2 is no longer needed as a workaround.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: any
  • Model/provider: Anthropic / claude-opus-4-6
  • Integration/channel: WhatsApp or Telegram

Steps

  1. Configure thinking=low
  2. Send a message via WhatsApp/Telegram
  3. Before fix: Thinking content appears as "Reasoning:\n_internal reasoning text_" in chat
  4. After fix: Only the actual response text is delivered

Expected

  • Thinking blocks are hidden; only the text response is sent.

Actual (before fix)

  • Full thinking content visible in chat, prefixed with "Reasoning:"

Evidence

  • Trace/log snippets — verified that resolvedReasoningLevel stays "off" when thinkLevel is set, preventing thinking block extraction and formatting.

Human Verification (required)

  • Verified scenarios: thinking=low + reasoning not explicitly set → reasoning stays off; thinking=off + reasoning-capable model → reasoning auto-enables as before.
  • Edge cases checked: Explicit /reasoning on with thinking=low → reasoning still works (explicit overrides auto-default).
  • What I did not verify: Live WhatsApp delivery (verified logic flow only).

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: Revert the thinkingActive guard in get-reply-directives.ts.
  • Files/config to restore: src/auto-reply/reply/get-reply-directives.ts
  • Known bad symptoms: If users want both thinking AND visible reasoning, they would need to explicitly set /reasoning on.

Risks and Mitigations

  • Risk: Users who relied on auto-enabled reasoning with thinking models lose it.
    • Mitigation: They can explicitly enable reasoning via /reasoning on. The auto-default was causing a bug, not a feature.

🤖 AI-assisted (Claude). Lightly tested — verified logic flow and regression analysis.

Made with Cursor

Greptile Summary

Prevents auto-enabling reasoning when thinking is already active, fixing a bug where internal thinking blocks were being formatted and delivered as visible "Reasoning:" messages to WhatsApp/Telegram users.

The fix adds a simple guard thinkingActive that checks if resolvedThinkLevel is set and not "off" before auto-enabling reasoning based on model capabilities. This prevents the conflict between two features that serve similar purposes - both expose model internal reasoning, but through different mechanisms.

  • Logic is sound: reasoning and thinking both expose model internal reasoning, so enabling both causes duplication/leakage
  • Explicit /reasoning on still works as expected (bypasses auto-default)
  • Backward compatible: users who want both can explicitly enable reasoning

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Simple, well-scoped bug fix that adds a single conditional check to prevent conflicting features from being enabled simultaneously. The logic is straightforward, the comment explains the rationale clearly, and explicit user overrides are preserved.
  • No files require special attention

Last reviewed commit: 0a5f3a1

ngutman added a commit to Kay-051/openclaw that referenced this pull request Feb 23, 2026
@ngutman ngutman force-pushed the fix/strip-thinking-blocks-from-delivery branch 2 times, most recently from a09356b to 31bc895 Compare February 23, 2026 13:07
ngutman added a commit to Kay-051/openclaw that referenced this pull request Feb 23, 2026
ngutman added a commit to Kay-051/openclaw that referenced this pull request Feb 23, 2026
@ngutman ngutman force-pushed the fix/strip-thinking-blocks-from-delivery branch from 31bc895 to dbd6b93 Compare February 23, 2026 13:09
ngutman added a commit to Kay-051/openclaw that referenced this pull request Feb 23, 2026
@ngutman ngutman force-pushed the fix/strip-thinking-blocks-from-delivery branch from dbd6b93 to f027732 Compare February 23, 2026 13:10
Kay-051 and others added 2 commits February 23, 2026 15:36
…nclaw#24290)

When thinking is set (e.g. thinking=low), the model produces internal
thinking blocks. The reasoning auto-default (based on model capability)
was formatting these blocks as "Reasoning:" text and delivering them to
WhatsApp/Telegram, leaking internal content to users.

Skip auto-enabling reasoning when thinkLevel is already set — the two
features serve the same purpose and enabling both causes the model's
internal thinking to be exposed as visible chat messages.

Users who explicitly set /reasoning on still get reasoning output.

Closes openclaw#24290

Co-authored-by: Cursor <[email protected]>
@ngutman ngutman force-pushed the fix/strip-thinking-blocks-from-delivery branch from f027732 to 8228ace Compare February 23, 2026 13:38
@ngutman ngutman merged commit 9d37654 into openclaw:main Feb 23, 2026
9 checks passed
@ngutman
Copy link
Copy Markdown
Contributor

ngutman commented Feb 23, 2026

Landed via temp rebase onto main.

  • Gate: pnpm check && pnpm tsgo && pnpm build
  • Land commit: 8228ace
  • Merge commit: 9d37654

Thanks @Kay-051!

@BillChirico
Copy link
Copy Markdown
Contributor

@Kay-051 Does this also support Discord? I'm having this issue with thinking=high and reasoning=off. Will this fix it as well?

r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
cesararevalo added a commit to DiagnoseEarly/openclaw that referenced this pull request Mar 26, 2026
* commit '3a3c2da9168f93397eeb3109d521819e10dc44fd': (4186 commits)
  [Feature]: Add Gemini (Google Search grounding) as web_search provider (openclaw#13075)
  test: optimize redundant suites for faster runtime
  test: reduce trigger test redundancy and speed up model coverage
  fix(agents): gate auto reasoning by effective thinking level (openclaw#24335) thanks @Kay-051
  fix(agents): don't auto-enable reasoning when thinking is active (openclaw#24290)
  test: consolidate shard tests for faster trigger/directive suites
  test: merge allow-from trigger shard and dedupe inline cases
  test: merge thinking and queue directive shards
  test: merge fuzzy model directive shards
  test: merge elevated allowlist directive shard
  test: consolidate directive behavior suites
  test: merge elevated status directive shards
  test: collapse directive behavior shards
  test: merge model picker tests into native command suite
  fix(agents): normalize strict openai-compatible turn ordering
  fix(models): refresh Moonshot Kimi vision capabilities
  fix(agents): detect Kimi model-token-limit overflows
  fix(agents): map Moonshot developer role compatibility
  ci: install pyyaml in skills-python job
  fix(auto-reply): hide direct-chat metadata without sender-id sentinel (openclaw#24373) thanks @jd316
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Thinking blocks leak into WhatsApp delivery + stale text fragments appended to replies (2026.2.22-2)

3 participants