You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reader (Rust): stream JSONL hot loops; use memchr crate (#372)
* reader (Rust): stream JSONL hot loops; use memchr crate
The Claude / Codex incremental and prescan paths previously built a
multi-GB up-front buffer (`vec![0u8; (size - start_offset) as usize]`,
`Vec::with_capacity((size - start_offset) as usize)` + `read_to_end`)
to scan a session log. Switch to BufReader + `read_until(b'\n', ...)`
into a reused line buffer so only the longest single line stays
resident, regardless of file size.
The main `parse_claude_session` loop also moves off
`BufReader::lines()` (a fresh `String` per line) onto `read_line` into
a reused `String`, keeping per-line allocation bounded by the longest
line for sessions with tens of thousands of turns.
`memchr_newline` in the codex parser was named for `memchr` but did
`buf.iter().position(|&b| b == b'\n')`. Wire the actual `memchr` crate
(already a transitive dep through `regex`) for SIMD-accelerated line
splits; pinned at the workspace root and depended on directly from
`relayburn-sdk` so we own the version.
Closes#323.
* codex reader: propagate read_until I/O errors
Address review feedback on #372: the codex streaming loop was
swallowing `read_until` failures via `Err(_) => break`, which would
silently truncate the parse at a transient mid-file read error and
advance the resume cursor as if the bytes had been processed. The
claude.rs equivalents already use `?` to propagate.
Bubble the error by changing `parse_codex_buffer` to return
`std::io::Result<ParseCodexIncrementalResult>` and using `?` in the
loop, matching `parse_codex_session_incremental`'s outer signature.
---------
Co-authored-by: Claude <noreply@anthropic.com>
-`relayburn-sdk` (Rust): reader hot loops in `claude.rs` and `codex.rs` now stream JSONL line-by-line via `BufReader::read_until` instead of pre-allocating a `(size - start_offset)`-byte buffer up front; only the longest single line stays resident. `memchr_newline` in the codex parser now actually uses the `memchr` crate for SIMD-accelerated newline scanning. The main `parse_claude_session` loop also drops `BufReader::lines()` in favor of `read_line` into a reused `String`. (#323)
8
+
7
9
## [2.0.0] - 2026-05-07
8
10
9
11
-`relayburn-sdk` (Rust): default ledger home moves from `~/.relayburn` to `~/.agentworkforce/burn` so the Rust 2.0 port and the TS 1.x package can coexist on disk during the #249 cutover. `RELAYBURN_HOME` (and the per-DB path overrides) continue to override the path; TS 1.x users on `~/.relayburn` are unaffected. Rust-port testers with data under the old path can `mv ~/.relayburn ~/.agentworkforce/burn` to carry it over (formats are not compatible — Rust treats any non-2.0 layout as empty and requires a `burn ingest` re-population).
0 commit comments