chore: repin bt-daemon to pick up the memory fix - #320
Open
Stephen Belanger (Qard) wants to merge 1 commit into
Open
chore: repin bt-daemon to pick up the memory fix#320Stephen Belanger (Qard) wants to merge 1 commit into
Stephen Belanger (Qard) wants to merge 1 commit into
Conversation
Moves the pin from 1ca65d4 to abd6756, which is braintrustdata/braintrust-coding-agent-plugins#23: "bound daemon memory so a long session cannot exhaust it". That fixes a daemon reaching 20 GB and crashing on a long session. Every Claude lifecycle event had been reading the whole transcript into memory and journaling it verbatim, so a session re-recorded its growing transcript every turn -- an 18 MB transcript produced a 1.6 GB journal, which replay then loaded and parsed entirely into memory. The daemon now mirrors transcript bytes once and references them, streams journal replay, retires idle sessions, and applies backpressure on session queues. Adds a hidden `--session-idle-timeout-secs` flag (default 300) to `bt trace daemon`. No source changes are needed here: bt only constructs bt-daemon's clap-parsed command schema, and the new field carries a default. Verified with `cargo check --locked --all-targets`, `cargo test auth::tests` (77 passed), and `cargo test trace` (40 passed). Clippy reports the same 14 pre-existing findings in bt's own code before and after the bump. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
|
Latest downloadable build artifacts for this PR commit
Available artifact names
|
Stephen Belanger (Qard)
requested review from
Abhijeet Prasad (AbhiPrasad),
Ankur Goyal (ankrgyl) and
Andrew Kent (realark)
August 18, 2026 05:41
Abhijeet Prasad (AbhiPrasad)
approved these changes
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the
bt-daemonpin from1ca65d4toabd6756, which is braintrustdata/braintrust-coding-agent-plugins#23 — "bound daemon memory so a long session cannot exhaust it".Why
A user reported the daemon reaching 20 GB before crashing. Every Claude lifecycle event had been reading the whole transcript into memory and journaling it verbatim, so a session re-recorded its growing transcript on every turn — an 18 MB transcript produced a 1.6 GB journal (142 snapshot lines accounted for 1.54 GB; all 5,852 other lines totalled 19 MB). Replay then loaded that file with
read_to_stringand parsed every line into aVecheld at once.The daemon now:
Nothing on disk is capped or truncated — only in-memory caches are bounded, and each is re-derivable from disk.
Scope
No source changes are needed in
bt. It only constructs bt-daemon's clap-parsed command schema (TraceArgs), and the one new field (ServeArgs::session_idle_timeout_secs) carries adefault_value_t, so this is not a breaking API change. It surfaces as a new hidden flag:The
Cargo.lockchange is deliberately limited to the onesourceline.cargo update -p bt-daemonalso re-resolved unrelated transitive picks (windows-sys,socket2,getrandom), which I reverted — the bump adds no dependencies, and pristinemainpasses--lockedcleanly, so that churn was noise.Verification
cargo check --locked --all-targets— cleancargo test auth::tests— 77 passed (what CI runs)cargo test trace— 40 passedcargo clippy --locked --all-targets --all-features -- -D warnings— 14 findings, identical before and after the bump. They are pre-existingcollapsible_iflints insrc/traces.rs,src/sql.rs, andsrc/datasets/pipeline.rsfrom a newer local clippy than CI's pinned toolchain; untouched here.btbinary.🤖 Generated with Claude Code