Unicode Parsing Error in Large Shell Snapshot Causing API Request Failure
Resolved 💬 3 comments Opened Jul 17, 2025 by yuyakurihara Closed Jan 5, 2026
Bug Description
- エラーメッセージ: 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 178993 (char 178992)"}}
- 現象: セッションが完全停止
- 原因: 大容量shell-snapshotファイル(99,226トークン)内のUnicode破損
- 環境: macOS Darwin 25.0.0、Sonnet 4モデル
Environment Info
- Platform: darwin
- Terminal: ghostty
- Version: 1.0.53
- Feedback ID: c0482797-8363-48d9-bb11-6e4a2351d8a9
Errors
[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n at genericNodeError (node:internal/errors:983:15)\n at wrappedFn (node:internal/errors:537:14)\n at checkExecSyncError (node:child_process:882:11)\n at execSync (node:child_process:954:15)\n at AI (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:728:6320)\n at file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:16554\n at Q (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:14406)\n at MF (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:14339)\n at zX (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:13205)\n at MB (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:19174)","timestamp":"2025-07-17T03:28:24.857Z"},{"error":"MaxFileReadTokenExceededError: File content (99226 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at QA4 (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1291:432)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1286:5788)\n at async J44 (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2223:9788)\n at async a$1 (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2223:6451)\n at async Dp (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1621:1318)\n at async W44 (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2223:5596)\n at async Z44 (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2223:5081)\n at async AH (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2223:3533)\n at async AH (file:///Users/yuyakurihara/.anyenv/envs/nodenv/versions/22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2223:4232)","timestamp":"2025-07-17T03:30:23.017Z"}]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗