Files
oh-my-pi/packages/coding-agent/test
oldschoola 4c4cc8857a fix(coding-agent): preserve multibyte UTF-8 across stream chunks in session loader
Address review: the per-chunk Buffer.from(chunk).toString("utf8") string concat corrupted multibyte sequences (e.g. ✓, emoji) that straddled a chunk boundary — silent data loss in exactly the ≥8MiB long sessions that take this path. Keep the buffer as a Uint8Array and pass it directly to Bun.JSONL.parseChunk (it accepts typed arrays and parses UTF-8 natively), so no decoding happens until a complete record is parsed. Only the title-slot first line is decoded, and only after the full line (up to its '\n') is buffered, so it is a complete UTF-8 sequence.

Also: drop the defensive 'read || 0' (read is number per typings); add a multibyte multi-chunk parity test (>128KiB fixture) that would have caught the bug.
2026-06-29 18:28:39 -07:00
..
2026-06-26 18:43:32 +02:00
2026-05-30 18:08:51 +02:00
2026-06-26 12:24:42 +02:00
2026-05-30 18:08:51 +02:00
2026-06-24 13:44:47 +00:00