#Session corruption: truncated streaming tool call stores unescaped newline in partialJson

1 messages Β· Page 1 of 1 (latest)

vast sphinx
#

Bug report: session corruption from truncated streaming tool call

GitHub issue filed: https://github.com/openclaw/openclaw/issues/69846

Summary: When Anthropic's streaming API is interrupted mid-tool-call, OpenClaw stores the incomplete JSON in a partialJson field on the JSONL record. That field contains a literal unescaped newline (0x0A), which causes JSON.parse to fail with:

Bad control character in string literal in JSON at position 111 (line 1 column 112)

The session enters a permanent crash loop β€” every subsequent message triggers the same error. Forked recovery sessions inherit the corruption. The only fix is manually stripping partialJson from the JSONL.

Reproduced: twice on the same agent in one day (Slack socket mode, anthropic/claude-sonnet-4-6, OpenClaw 2026.4.15)

Full reproduction steps and manual fix in the GitHub issue.

dusty arrowBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> βœ… Mark Solution

shrewd pawnBOT