Skip to content

Feature: Add reasoningDefault config key to agents.defaultsΒ #1

@marcbal77

Description

@marcbal77

Problem

When using a model with reasoning: true in the catalog (e.g., claude-opus-4-6 which inherits from the claude-opus-4-5 template), resolveReasoningDefault() auto-enables reasoning ("on") for new sessions. This causes the model's thinking/reasoning block to be included in outbound messages on channels like Discord, prefixed with Reasoning:\n.

There is no config-level way to override this. The agents.defaults schema validates with .strict() and only recognizes thinkingDefault, verboseDefault, and elevatedDefault β€” but not reasoningDefault.

Current behavior

// dispatch line ~100301
if (no explicit directive && no session reasoning level && resolvedReasoningLevel === "off" && thinking is off)
    resolvedReasoningLevel = await modelState.resolveDefaultReasoningLevel();
    // β†’ returns "on" for models with reasoning: true in catalog

The isReasoning block-reply filter works correctly for streaming block replies, but when reasoning is "on" and there's no onBlockReply callback, the reasoning text gets inlined into the assistant message text (line ~51797).

Affected channels

Discord (confirmed), likely any channel where reasoning text leaks into the final message.

Expected behavior

Allow agents.defaults.reasoningDefault: "off" (or per-agent reasoningDefault) to override the catalog-derived default reasoning level, consistent with how thinkingDefault, verboseDefault, and elevatedDefault work.

Workaround

  1. Manually set reasoningLevel: "off" on each session entry in the session store JSON
  2. Patch resolveReasoningDefault() in dist to always return "off"

Both are fragile β€” session fix doesn't prevent new sessions from auto-enabling, and dist patch is overwritten on upgrade.

Environment

  • OpenClaw 2026.3.11
  • Model: anthropic/claude-opus-4-6 (inherits reasoning: true from opus-4-5 template)
  • Channel: Discord

πŸ€– Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions