Issue evidence · AI API · n8n-io/n8n

AI Agent: Anthropic thinking block is duplicated across parallel tool calls, Anthropic API rejects the next turn

GitHub issue: https://github.com/n8n-io/n8n/issues/41152

Confirmed from source (not run)

With parallel tool calls, the agent replays the same signed thinking block in front of each tool_use, so Anthropic rejects the next request.

What Badgr ran

Read packages/@n8n/nodes-langchain/utils/agent-execution/createEngineRequests.ts and buildSteps.ts on n8n master (2026-10-15). Not run: no Anthropic key was available.

What came back

  • createEngineRequests.ts (extractThinkingMetadata) copies the thinking signature into each tool action's metadata.
  • buildSteps.ts has buildSharedGeminiAIMessage for parallel Gemini calls but no equivalent for Anthropic; each tool call goes through buildIndividualAIMessage and buildAnthropicContentBlocks.

Code reading only (not run): the 400 from Anthropic was not reproduced.

Checked 2026-10-15 in Badgr’s local development environment.

← All issue evidence