Skip to content

Anthropic subagents fail with reasoning.effort due to thinking signature replay in multi-turn sessions #16246

@vicary

Description

@vicary

Description

Summary

Anthropic-backed subagents fail when reasoning.effort is enabled. The failure appears on a later model call in a multi-turn / tool-using / resumed subagent session with errors such as:

  • Invalid 'signature' in 'thinking' block
  • thinking.signature: Field required

Removing reasoning.effort from the subagent config makes the same flow stop failing.

Environment / shape of failure

  • Affected path: Anthropic-backed subagents
  • Trigger: reasoning.effort enabled in agent frontmatter
  • Typical failing shape: second or later API call in the same subagent session
  • Common ingredients: tool use, multi-turn execution, or session replay/resume

What I ruled out

This does not appear to be primarily caused by switching from GPT/OpenAI to Anthropic in the same session. I have:

  • Anthropic-only failures with the same error
  • GPT -> Anthropic sessions that do not fail this way

So the stronger correlation is specifically with Anthropic thinking mode being enabled via reasoning.effort.

Suspected root cause

This looks like a subagent history replay / truncation / normalization bug for Anthropic thinking blocks.

My current hypothesis is:

  1. reasoning.effort enables Anthropic extended thinking
  2. the first Claude turn succeeds and emits a thinking block with signature metadata
  3. on a later subagent call, prior assistant history is replayed without preserving the thinking/signature payload exactly
  4. Anthropic rejects the reconstructed conversation with a 400 signature error

This seems closely related to prior Anthropic thinking-block replay issues, but likely on the subagent path specifically.

Minimal workaround

Remove reasoning.effort from the Anthropic-backed subagent frontmatter. That reliably avoids the failure locally.

Expected behavior

Anthropic-backed subagents with reasoning.effort should be able to survive multi-turn execution, tool use, and resumed/replayed session history without signature-related API failures.

Related issues / prior art

These look related, but not identical:

There is also a public community report that appears to describe the same subagent-specific failure mode:

Notes

I can provide a tighter repro if needed, but the highest-signal trigger I found is simply:

  • Anthropic subagent
  • reasoning.effort enabled
  • multi-turn / tool-using session
  • later call fails with thinking signature validation

Plugins

None relevant / default setup

OpenCode version

Current local install as of 2026-03-06 (exact version not captured in-session)

Steps to reproduce

  1. Configure a subagent backed by an Anthropic Claude model.
  2. Add reasoning.effort to the agent frontmatter.
  3. Run a task that causes the subagent to take multiple turns, especially with tool use or resumed/replayed session history.
  4. Observe that a later model call fails with a thinking-signature validation error.
  5. Remove reasoning.effort and rerun the same flow.
  6. Observe that the failure disappears.

Screenshot and/or share link

Related prior art:

Operating System

macOS

Terminal

OpenCode CLI session

Metadata

Metadata

Assignees

Labels

acpbugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions