[Bug] Anthropic API Error: Invalid JSON Request Body During File Edit
Resolved 💬 3 comments Opened Sep 15, 2025 by tennox Closed Sep 19, 2025
Bug Description
during/after file editing, I got this:
320 - print $"(ansi yellow_bold)($cd_command)(ansi reset)"
320 + if not $quiet {
321 + print $"(ansi yellow_bold)($cd_command)(ansi reset)"
322 + }
323
324 # Copy to clipboard if wl-copy is available
325 # if (which wl-copy | is-not-empty) {
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"The request
body is not valid JSON: no low surrogate in string: line 1 column 118482 (char
118481)"},"request_id":"req_011CT9yPZ9R8joGAkGuGDR79"}
> hickup, continue
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"The request
body is not valid JSON: no low surrogate in string: line 1 column 118482 (char
118481)"},"request_id":"req_011CT9yQZLrMgA9ohUNyC13Z"}
Environment Info
- Platform: linux
- Terminal: alacritty
- Version: 1.0.109
- Feedback ID: a7eba5c7-9514-468f-b04f-c453afa35897
Errors
[{"error":"SyntaxError: Unexpected non-whitespace character after JSON at position 57\n at JSON.parse (<anonymous>)\n at file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:733:9932\n at Q (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:713:13288)\n at at2 (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:1095:1982)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-09-15T08:28:34.267Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at _V (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:1735:1184)\n at file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:1735:912\n at Array.map (<anonymous>)\n at UX (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:1735:903)\n at iaB (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:3556:13837)\n at lD (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:84:19415)\n at wl (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:42814)\n at V9 (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38355)\n at yf (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38283)\n at BC (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38137)","timestamp":"2025-09-15T09:13:08.265Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at _V (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:1735:1184)\n at file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:1735:912\n at Array.map (<anonymous>)\n at UX (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:1735:903)\n at iaB (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:3556:13837)\n at lD (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:84:19415)\n at wl (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:42814)\n at V9 (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38355)\n at yf (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38283)\n at BC (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38137)","timestamp":"2025-09-15T09:13:08.285Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at _V (file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:1735:1184)\n at file:///nix/store/didsrxk70gcr7y3xfj0vcm3a8fm9jyr3-claude-code-1.0.109/lib/node_modules/@anthropic-ai/claude-code/cli.js:1735:912\n at Array.map (<anonymous>)\n at UX (file:///nix/store/didsrxk
Note: Error logs were truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗