- Restored CustomInputRow.priority field dropped in 3b80dc01d ask row budgeting.
- Narrowed dereferenced schema properties via isRecord in yield-assembly and output-schema-validator instead of untyped object access.
- Renamed stale advisorReadOnlyTools to advisorTools in advisor parity test.
- Narrowed AgentMessage content access in session-loader-stream test.
- Reformatted browser-schema test to satisfy biome.
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.
The ≥8MiB session-load path (loadEntriesFromFileStream) used node:readline + per-line JSON.parse, while the common (<8MiB) path already used Bun's native Bun.JSONL. The large-session path is now the lone outlier getting the slower parser.
Rewrite loadEntriesFromFileStream to a lenient streaming Bun.JSONL.parseChunk loop: stream the file via Bun.file().stream() into a bounded buffer (memory guard preserved — the file is never fully loaded, which is why the 8MiB threshold exists), skip malformed records to the next newline instead of throwing, peel/fold the non-JSON first-line title slot, terminate a trailing newline-less record, and keep isEnoent→empty. Removed the now-unused node:fs + node:readline imports.
Measured ~9.5ms → ~6.0ms (-37%) loading a 10MiB valid session; the remaining cost is I/O + native parse (floor).
Correctness: new session-loader-stream.test.ts asserts the stream path produces byte-identical entries + titleSlot to parseSessionContent (the common-path parser) across title-slot / blank / malformed / no-trailing-newline / missing-file cases.