claude-code
claude-code copied to clipboard
Claude Thinking Block Validation Error: Missing Required Thinking Block
Bug Description
Thinking is causing this error frequently: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.21.content.0.type: Expected thinking or redacted_thinking, but found text. When
thinking is enabled, a final assistant message must start with a thinking block (preceeding the lastmost set of tool_use and tool_result blocks). We recommend you include
thinking blocks from previous turns. To avoid this requirement, disable thinking. Please consult our documentation at
https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking"}}
Environment Info
- Platform: macos
- Terminal: vscode
- Version: 0.2.122
- Feedback ID: aae2bcc7-339d-4282-8970-24f4a269747d
Errors
[{"error":"Error: EISDIR: illegal operation on a directory, read\n at Module.readSync (node:fs:742:18)\n at Object.readSync (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:499:901)\n at eD (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:502:260)\n at nB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:504:358)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1807:1396\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-05-20T03:05:32.455Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n at Module.readFileSync (node:fs:443:20)\n at Object.readFileSync (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:499:728)\n at nB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:504:376)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1807:1396\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-05-20T03:05:32.455Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at II (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1850:6010)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1850:5746\n at Array.map (<anonymous>)\n at Ob (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1850:5737)\n at $e2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1850:9709)\n at kw (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:91:19797)\n at sM (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:93:42551)\n at nM (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:93:38100)\n at B$ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:93:38028)\n at tw (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:93:37882)","timestamp":"2025-05-20T03:06:10.689Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at II (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1850:6010)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1850:5746\n at Array.map (<anonymous>)\n at Ob (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1850:5737)\n at $e2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1850:9709)\n at kw (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:91:19797)\n at sM (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:93:42551)\n at nM (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:93:38100)\n at B$ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:93:38028)\n at tw (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:93:37882)","timestamp":"2025-05-20T03:06:10.690Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: local\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1274:10912\n at Object.useMemo (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:91:26270)\n at _K4.useMemo (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:71:83971)\n at UF (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1274:10806)\n at kw (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:91:19797)\n at sM (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:93:42551)\n at nM (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:93:38100)\n at B$ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:93:38028)\n at tw (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:93:37882)\n at WV (file:///opt/homebrew/lib/node_mod
Note: Error logs were truncated.
duplicate of #1179