Skip to content

Anthropic API Request Fails with Unexpected Parsing Error #6242

@ghost

Description

Bug Description
/var/folders/d_/5zlgnkrn4b7bmtw5lmcksdw40000gn/T/TemporaryItems/NSIRD_screencaptureui_fL5Zfq/Screenshot\ 2025-08-21\ at\ 7.23.01 AM.png

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 1.0.86
  • Feedback ID: 4737330c-6157-4a11-9824-736f2fcb5666

Errors

[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.2: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_016stRu8dWd4rjmFSVxuJNpo, toolu_01HoLGa45JzuhsCXAKYZHNnc, toolu_01XxnkMPcEiLTveah3oW9Ku7. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"},\"request_id\":\"req_011CSLmVyZCJ9sNjG5b8wKdZ\"}\n    at b4.generate (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:932:2412)\n    at dP.makeStatusError (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:949:2101)\n    at dP.makeRequest (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:949:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async LD1.showErrors (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1904:27238)\n    at async LD1 (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1904:16345)\n    at async l9B (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1904:27089)\n    at async file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1904:22183\n    at async dH0 (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1904:3514)\n    at async V11 (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1904:22153)","timestamp":"2025-08-21T11:22:16.825Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.2: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_016stRu8dWd4rjmFSVxuJNpo, toolu_01HoLGa45JzuhsCXAKYZHNnc, toolu_01XxnkMPcEiLTveah3oW9Ku7. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"},\"request_id\":\"req_011CSLmXx1F1umEDiVkTzXj8\"}\n    at b4.generate (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:932:2412)\n    at dP.makeStatusError (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:949:2101)\n    at dP.makeRequest (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:949:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async LD1.showErrors (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1904:27238)\n    at async LD1 (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1904:16345)\n    at async l9B (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1904:27089)\n    at async file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1904:22183\n    at async dH0 (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1904:3514)\n    at async V11 (file:///Users/matthewscott/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1904:22153)","timestamp":"2025-08-21T11:22:43.538Z"}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiarea:corebugSomething isn't workingduplicateThis issue or pull request already existsplatform:macosIssue specifically occurs on macOS

    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