openclaw - 💡(How to fix) Fix Subagent completion announce/wake run fails on Anthropic reasoning models (claude-opus-4.x): inherited deprecated thinking schema → direct ping lost, only orphan-recovery delivers

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…

On Anthropic reasoning models (Opus 4.x), the subagent completion announce/wake internal run inherits the child session's thinkingLevel and emits the deprecated thinking.type.enabled schema, which the model rejects. The direct completion ping fails (delivered=false) and only the orphan-recovery handler delivers, producing a spurious "ping mancante" notice on every subagent completion.

Error Message

Error (Anthropic API):

Root Cause

## Root cause (file:line, installed bundle 2026.5.12)

Fix Action

Fix / Workaround

  1. Subagent spawn applies subagents.thinking to the child session — dist/subagent-spawn-Bym_NHEH.js:

    • L205: resolvedThinkingDefaultRaw = readString(targetSubagents, "thinking") ?? readString(defaultSubagents, "thinking")
    • L212-220: normalizes and writes initialSessionPatch: { thinkingLevel: normalizedThinking === "off" ? null : normalizedThinking }
    • L334: persists entry.thinkingLevel on the run record. The child session carries a thinkingLevel, derived from config (or null when subagents.thinking is unset).
  2. The announce/wake run does NOT pass an explicit thinking payload — dist/subagent-announce-Cdo94lsz.js:

    • L91-95: dispatchGatewayMethodInProcess("agent", { sessionKey: params.childSessionKey, message: wakeMessage, deliver: false, ... })
    • It relies on the child session's inherited reasoning config. No thinking/output_config override on this internal run. The serialized reasoning parameter uses the deprecated thinking.type.enabled shape, which Opus 4.x rejects.
  3. Recovery path succeeds because the orphan-recovery handler dispatches from a persistent context that does not reconstruct the same agent-mediated reasoning payload.

Code Example

## Root cause (file:line, installed bundle 2026.5.12)

1. Subagent spawn applies subagents.thinking to the child session — dist/subagent-spawn-Bym_NHEH.js:
   - L205: resolvedThinkingDefaultRaw = readString(targetSubagents, "thinking") ?? readString(defaultSubagents, "thinking")
   - L212-220: normalizes and writes initialSessionPatch: { thinkingLevel: normalizedThinking === "off" ? null : normalizedThinking }
   - L334: persists entry.thinkingLevel on the run record.
   The child session carries a thinkingLevel, derived from config (or null when subagents.thinking is unset).

2. The announce/wake run does NOT pass an explicit thinking payload — dist/subagent-announce-Cdo94lsz.js:
   - L91-95: dispatchGatewayMethodInProcess("agent", { sessionKey: params.childSessionKey, message: wakeMessage, deliver: false, ... })
   - It relies on the child session's inherited reasoning config. No thinking/output_config override on this internal run. The serialized reasoning parameter uses the deprecated thinking.type.enabled shape, which Opus 4.x rejects.

3. Recovery path succeeds because the orphan-recovery handler dispatches from a persistent context that does not reconstruct the same agent-mediated reasoning payload.

Note: the cron path is unaffected — cron runs already carry the current thinking: adaptive schema. The defect is specific to the subagent announce/wake internal run.

## Suggested fixes (any one)

1. Preferred: force thinking=off (no reasoning param) on the announce/wake internal run in subagent-announce-Cdo94lsz.js — it's a mechanical delivery, reasoning is unnecessary. Lowest risk, surgical.
2. Pass the current-schema reasoning payload explicitly on that run instead of relying on inherited session thinkingLevel.
3. Normalize any inherited thinking.type.enabled to thinking.type.adaptive + output_config.effort at the agent-dispatch boundary for Anthropic reasoning models.

## Workaround (operator-side, not a fix)

Setting agents.defaults.subagents.thinking = "off" makes every child session start with thinkingLevel = null (L220), which likely prevents the announce run from emitting the deprecated payload — but it is unverified deterministically for the announce path, and disables reasoning for all subagents globally. Not a targeted fix.

Observed: 5/5 subagents in one session, 28 rejections in a ~1h window, 100% reproducible.
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

On Anthropic reasoning models (Opus 4.x), the subagent completion announce/wake internal run inherits the child session's thinkingLevel and emits the deprecated thinking.type.enabled schema, which the model rejects. The direct completion ping fails (delivered=false) and only the orphan-recovery handler delivers, producing a spurious "ping mancante" notice on every subagent completion.

Steps to reproduce

  1. OpenClaw 2026.5.12, agents.defaults.model.primary = anthropic/claude-opus-4-8.
  2. Spawn any trivial subagent task (mode=run).
  3. On completion, observe the direct ping with delivered=false and the Anthropic invalid_request_error below, followed by orphan-recovery delivery + a "ping mancante" notice.

Expected behavior

The internal announce/wake run is a mechanical delivery; it should either send no reasoning parameter, or send the current-schema reasoning payload (thinking.type.adaptive + output_config.effort). The direct ping should be delivered=true.

Actual behavior

The run inherits/serializes the deprecated thinking.type.enabled form → invalid_request_error → delivered=false → recovery-only delivery + spurious "ping mancante" notice.

Error (Anthropic API): invalid_request_error — "thinking.type.enabled" is not supported for this model. Use "thinking.type.adaptive" and "output_config.effort"

OpenClaw version

2026.5.12

Operating system

Ubuntu 24.04

Install method

npm global

Model

anthropic/claude-opus-4-8

Provider / routing chain

openclaw → api.anthropic.com (direct, no proxy)

Additional provider/model setup details

Provider baseUrl: https://api.anthropic.com Config: agents.defaults.models["anthropic/claude-opus-4-8"].params.thinking = "adaptive" (new schema, correct). agents.defaults.subagents = null, agents.defaults.announce = null, agents.defaults.thinking = null.

Logs, screenshots, and evidence

## Root cause (file:line, installed bundle 2026.5.12)

1. Subagent spawn applies subagents.thinking to the child session — dist/subagent-spawn-Bym_NHEH.js:
   - L205: resolvedThinkingDefaultRaw = readString(targetSubagents, "thinking") ?? readString(defaultSubagents, "thinking")
   - L212-220: normalizes and writes initialSessionPatch: { thinkingLevel: normalizedThinking === "off" ? null : normalizedThinking }
   - L334: persists entry.thinkingLevel on the run record.
   The child session carries a thinkingLevel, derived from config (or null when subagents.thinking is unset).

2. The announce/wake run does NOT pass an explicit thinking payload — dist/subagent-announce-Cdo94lsz.js:
   - L91-95: dispatchGatewayMethodInProcess("agent", { sessionKey: params.childSessionKey, message: wakeMessage, deliver: false, ... })
   - It relies on the child session's inherited reasoning config. No thinking/output_config override on this internal run. The serialized reasoning parameter uses the deprecated thinking.type.enabled shape, which Opus 4.x rejects.

3. Recovery path succeeds because the orphan-recovery handler dispatches from a persistent context that does not reconstruct the same agent-mediated reasoning payload.

Note: the cron path is unaffected — cron runs already carry the current thinking: adaptive schema. The defect is specific to the subagent announce/wake internal run.

## Suggested fixes (any one)

1. Preferred: force thinking=off (no reasoning param) on the announce/wake internal run in subagent-announce-Cdo94lsz.js — it's a mechanical delivery, reasoning is unnecessary. Lowest risk, surgical.
2. Pass the current-schema reasoning payload explicitly on that run instead of relying on inherited session thinkingLevel.
3. Normalize any inherited thinking.type.enabled to thinking.type.adaptive + output_config.effort at the agent-dispatch boundary for Anthropic reasoning models.

## Workaround (operator-side, not a fix)

Setting agents.defaults.subagents.thinking = "off" makes every child session start with thinkingLevel = null (L220), which likely prevents the announce run from emitting the deprecated payload — but it is unverified deterministically for the announce path, and disables reasoning for all subagents globally. Not a targeted fix.

Observed: 5/5 subagents in one session, 28 rejections in a ~1h window, 100% reproducible.

Impact and severity

Affected: every subagent completion on Anthropic reasoning models (Opus 4.x). Severity: cosmetic/observability — no data loss, completion content is always recovered. Frequency: 100% (5/5 subagents, 28 rejections in ~1h). Consequence: defeats the direct-ping UX, floods every completion with a spurious recovery notice, and burns one failed Anthropic call per subagent completion.

Additional information

The deprecated schema appears only on the subagent announce/wake path; cron runs are already on the current thinking: adaptive schema. A targeted fix on the announce run (preferred fix #1) resolves it without affecting subagent reasoning elsewhere.

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…

FAQ

Expected behavior

The internal announce/wake run is a mechanical delivery; it should either send no reasoning parameter, or send the current-schema reasoning payload (thinking.type.adaptive + output_config.effort). The direct ping should be delivered=true.

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 Subagent completion announce/wake run fails on Anthropic reasoning models (claude-opus-4.x): inherited deprecated thinking schema → direct ping lost, only orphan-recovery delivers