Repository navigation
Labels
confirmed-reproBug reproduced again from a clean trusted checkout; see linked reportperfthreadsTurns, timeline, messaging, forks
Description
Summary
The thread timeline response cache keys entries by both request parameters and the thread's current max sequence. Every appended event therefore creates a new key while the obsolete revision remains resident until global LRU eviction, so active threads can retain many superseded response payloads instead of one current revision per request shape.
Versions and environment
- bb 0.39.0 desktop app
- macOS on Apple Silicon, 8 GB RAM
- Node v22.19.0 for the source-level reproduction
- Source behavior inspected on main; the affected cache implementation was unchanged at
6be4505
Steps to reproduce
- Create a
ThreadTimelineCachewith a capacity greater than one. - Call
getOrBuildfor a cacheable response using one request shape and revision/max-sequence A. - Append an event, then call it again with the same request shape and revision/max-sequence B.
- Inspect the cache entry count.
- A regression assertion expecting one retained entry fails before the fix with
2 !== 1.
A concrete regression test and fix are available in commit Yazington@206096e.
Expected vs actual
Actual: cache size is 2 after two revisions of the same request shape
Expected: cache size is 1, containing only the newest revision
The same request shape should replace its obsolete revision immediately. Distinct request shapes should continue to coexist and follow the normal LRU limit.
Evidence
- A live active thread had 5,749 events and about 11.3 MiB of event data.
- Server logs contained 54 slow timeline builds, with windows around 1,400 events, response payloads around 1.1–4.8 MiB, and build times up to 1.34 seconds.
- The desktop app used roughly 1.5–1.7 GB total memory during the incident; the renderer was about 670 MiB and the server about 300–650 MiB.
- The cache allowed 128 entries. Because its key included
maxSeq, each append made the prior response unreachable by lookup but still strongly retained by the map. - The active Codex thread remained below the cache's projected-row cutoff, so those revision payloads were eligible for caching.
What you ruled out
- Not a duplicate of timelineWindowEventBudget assumes 0.06ms/event; measured 0.479ms/event on a 4-core host #1749: that issue focuses on timeline event-budget calibration; this issue is specifically obsolete revision retention.
- The direct cache regression reproduces without Playwright or browser automation.
- The fix does not change response data, request parameters, or cacheability thresholds.
Suggested priority and effort (optional)
Medium — affects long-running active threads and can amplify server heap use; the fix is localized and low effort.
Checks
- I reproduced this on the latest release or on
main, or I say above that I could not. - I searched open and closed issues for the same problem.
- If an agent wrote this, the body ends with
> AGENT GENERATED: by <model>and links the thread or report.
AGENT GENERATED: by OpenAI Codex (GPT-5)
Metadata
Metadata
Assignees
Labels
confirmed-reproBug reproduced again from a clean trusted checkout; see linked reportperfthreadsTurns, timeline, messaging, forks
Activity
SawyerHood commentedon Aug 21, 2026
Reproduction & root-cause report: https://get-bb.github.io/reports/issues/2066.html
${maxSeq}|${paramsKey}; maxSeq is monotonic so each appended event makes the prior entry unreachable but it stays in the 128-entry LRU, and the 200-row cap does not exclude ordinary streaming turns, so one viewed streaming thread fills all 128 slots with dead full responses.The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at the base commit, and repro artifacts. It was independently re-run by a second agent (see its Verification section).
Keep one timeline cache revision per request shape (get-bb#7034)