Crash on conversation resume: H.indexOf is not a function in isResultTruncated

Resolved 💬 3 comments Opened Apr 3, 2026 by cstripling-brex Closed Apr 18, 2026

Bug

Resuming a conversation crashes with:

ERROR  H.indexOf is not a function. (In 'H.indexOf(`
        `,_)', 'H.indexOf' is undefined)

Stack trace

Hb (/$bunfs/root/src/entrypoints/cli.js:1518:65)
isResultTruncated (/$bunfs/root/src/entrypoints/cli.js:1540:4784)
<anonymous> (/$bunfs/root/src/entrypoints/cli.js:5959:15701)
<anonymous> (/$bunfs/root/src/entrypoints/cli.js:5959:7779)
map (native:1:11)
QW7 (/$bunfs/root/src/entrypoints/cli.js:5959:7735)
fO (/$bunfs/root/src/entrypoints/cli.js:480:20983)
qA (/$bunfs/root/src/entrypoints/cli.js:480:39521)
Gk (/$bunfs/root/src/entrypoints/cli.js:480:50210)
EDH (/$bunfs/root/src/entrypoints/cli.js:480:86865)

Analysis

isResultTruncated calls .indexOf("\n") on a value (H) that is undefined instead of a string. This likely happens when a tool result in the persisted conversation has a null/undefined content field that isn't guarded before the string method call.

Reproduction

  1. Have a conversation with tool calls
  2. Exit
  3. Resume with claude --resume
  4. Crash occurs during conversation restoration

Environment

  • Platform: macOS (Darwin 24.6.0)
  • Runtime: Bun

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗