openclaw - 💡(How to fix) Fix [Bug] --thinking flag doesn't enable thinking for MiniMax via Anthropic API [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#69980Fetched 2026-04-23 07:30:43
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

Root Cause

  1. Create a cron job with --thinking medium --model minimax/MiniMax-M2.7
  2. Observe the payload contains thinking: "medium" but NOT reasoning
  3. The API request to MiniMax does NOT include thinking because options?.reasoning is undefined

Code Example

Cron: --thinking medium
Payload: { thinking: "medium" }pi-embedded-runner: params.thinkLevel = "medium"
requestShaping: {
    thinking: "medium"   (set correctly)
    reasoning: undefined  (NOT set!)
}
Agent runner: requestShaping.thinking = "medium"
              requestShaping.reasoning = undefined
HTTP Layer (anthropic-vertex-stream-CpkZd5Cl.js):
if (!options?.reasoning) {
    resolved.thinkingEnabled = false;  // ← Thinking disabled!
    return resolved;
}
Thinking NEVER enabled ❌

---

assignIf(payload, "thinking", thinking, Boolean(thinking));
   // Only sets "thinking" field, not "reasoning"

---

requestShaping: {
       ...thinkLevel ? { thinking: thinkLevel } : {},
       ...params.reasoningLevel ? { reasoning: params.reasoningLevel } : {},
       //          ↑ This is undefined because cron sets "thinking", not "reasoningLevel"
   }

---

if (!options?.reasoning) {
       resolved.thinkingEnabled = false;  // Thinking disabled!
       return resolved;
   }

---

thinking: runResult.meta?.requestShaping?.thinking ?? normalizeOptionalString(followupRun.run.thinkLevel),
   reasoning: runResult.meta?.requestShaping?.reasoning ?? normalizeOptionalString(followupRun.run.reasoningLevel),
   //          ↑ Only uses "reasoning" for the API, not "thinking"

---

assignIf(payload, "thinking", thinking, Boolean(thinking));
assignIf(payload, "reasoningLevel", thinking, Boolean(thinking)); // Add this

---

reasoning: runResult.meta?.requestShaping?.reasoning ?? normalizeOptionalString(followupRun.run.thinkLevel) ?? normalizeOptionalString(followupRun.run.thinking),

---

if (!options?.reasoning && !options?.thinking) {
    resolved.thinkingEnabled = false;
    return resolved;
}
RAW_BUFFERClick to expand / collapse

Issue: --thinking flag doesn't enable thinking for MiniMax models via Anthropic API

Problem Description

The --thinking <level> flag in cron jobs sets the thinking field in the payload, but the HTTP API layer checks the reasoning field instead. This causes thinking to never be enabled for MiniMax models (or any provider using the Anthropic API).

Reproduction Steps

  1. Create a cron job with --thinking medium --model minimax/MiniMax-M2.7
  2. Observe the payload contains thinking: "medium" but NOT reasoning
  3. The API request to MiniMax does NOT include thinking because options?.reasoning is undefined

Root Cause Analysis

Data Flow

Cron: --thinking medium
Payload: { thinking: "medium" }  ✅
pi-embedded-runner: params.thinkLevel = "medium"
requestShaping: {
    thinking: "medium"  ✅ (set correctly)
    reasoning: undefined ❌ (NOT set!)
}
Agent runner: requestShaping.thinking = "medium"
              requestShaping.reasoning = undefined
HTTP Layer (anthropic-vertex-stream-CpkZd5Cl.js):
if (!options?.reasoning) {
    resolved.thinkingEnabled = false;  // ← Thinking disabled!
    return resolved;
}
Thinking NEVER enabled ❌

Key Code Locations

  1. Cron CLI (cron-cli-DDDz-P5B.js:528):

    assignIf(payload, "thinking", thinking, Boolean(thinking));
    // Only sets "thinking" field, not "reasoning"
  2. Pi-embedded-runner (pi-embedded-runner-BBok3J7Q.js:2625-2626):

    requestShaping: {
        ...thinkLevel ? { thinking: thinkLevel } : {},
        ...params.reasoningLevel ? { reasoning: params.reasoningLevel } : {},
        //          ↑ This is undefined because cron sets "thinking", not "reasoningLevel"
    }
  3. Anthropic Vertex Stream (anthropic-vertex-stream-CpkZd5Cl.js:551):

    if (!options?.reasoning) {
        resolved.thinkingEnabled = false;  // Thinking disabled!
        return resolved;
    }
  4. Agent Runner (agent-runner.runtime-C-qz3ZFr.js:3239-3240):

    thinking: runResult.meta?.requestShaping?.thinking ?? normalizeOptionalString(followupRun.run.thinkLevel),
    reasoning: runResult.meta?.requestShaping?.reasoning ?? normalizeOptionalString(followupRun.run.reasoningLevel),
    //          ↑ Only uses "reasoning" for the API, not "thinking"

Expected Behavior

When a cron job is created with --thinking medium, the thinking parameter should be sent to the API, enabling the model's thinking/reasoning capabilities.

Actual Behavior

The thinking field is set in the payload but never converted to the reasoning field that the API actually checks.

Environment

  • OpenClaw: 2026.4.21 (f788c88)
  • Node.js: v22.22.1
  • macOS: Darwin 25.3.0 (arm64)
  • Provider: minimax (MiniMax-M2.7, MiniMax-M2.7-highspeed)

Suggest Fix

Either:

Option A: In cron-cli-DDDz-P5B.js, also set reasoningLevel when --thinking is provided:

assignIf(payload, "thinking", thinking, Boolean(thinking));
assignIf(payload, "reasoningLevel", thinking, Boolean(thinking)); // Add this

Option B: In agent-runner.runtime-C-qz3ZFr.js, use thinking as fallback for reasoning:

reasoning: runResult.meta?.requestShaping?.reasoning ?? normalizeOptionalString(followupRun.run.thinkLevel) ?? normalizeOptionalString(followupRun.run.thinking),

Option C: In anthropic-vertex-stream-CpkZd5Cl.js, check both reasoning and thinking:

if (!options?.reasoning && !options?.thinking) {
    resolved.thinkingEnabled = false;
    return resolved;
}

extent analysis

TL;DR

The --thinking flag doesn't enable thinking for MiniMax models via the Anthropic API because the reasoning field is not set in the payload.

Guidance

  1. Verify the payload: Check the payload sent to the API to confirm that it contains the thinking field but not the reasoning field.
  2. Update the cron CLI: Consider updating the cron-cli-DDDz-P5B.js file to set both thinking and reasoningLevel fields when the --thinking flag is provided.
  3. Check API documentation: Review the Anthropic API documentation to ensure that the reasoning field is the correct field to use for enabling thinking.
  4. Test the fix: After applying the fix, test the cron job with the --thinking flag to verify that thinking is enabled for the MiniMax model.

Example

// In cron-cli-DDDz-P5B.js
assignIf(payload, "thinking", thinking, Boolean(thinking));
assignIf(payload, "reasoningLevel", thinking, Boolean(thinking)); // Add this line

Notes

The provided fix options (A, B, C) may have different implications for the system, and it's essential to evaluate each option's potential impact before applying the fix.

Recommendation

Apply Option A: Update the cron-cli-DDDz-P5B.js file to set both thinking and reasoningLevel fields when the --thinking flag is provided, as it directly addresses the issue and ensures consistency in the payload.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug] --thinking flag doesn't enable thinking for MiniMax via Anthropic API [1 participants]