Skip to content

fix: bound reasoning cache writes - #2636

Open
guillaumegay13 wants to merge 1 commit into
mnfst:mainfrom
guillaumegay13:fix/bound-reasoning-cache-writes
Open

fix: bound reasoning cache writes#2636
guillaumegay13 wants to merge 1 commit into
mnfst:mainfrom
guillaumegay13:fix/bound-reasoning-cache-writes

Conversation

@guillaumegay13

@guillaumegay13 guillaumegay13 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • cap reasoning cache values at 256 KiB and local content at 64 MiB
  • limit shared-cache persistence to four concurrent and 256 queued writes
  • coalesce queued updates by session and tool call

Testing

  • reasoning content cache unit tests
  • backend build
  • ESLint and changeset validation

Summary by cubic

Bound reasoning cache memory and DB write throughput to prevent stalls and memory bloat during database backpressure. Adds size caps, write coalescing, and concurrency limits for shared-cache persistence.

  • Bug Fixes
    • Cap single reasoning_content to 256 KiB; drop oversized values (local and shared).
    • Cap local cache to 64 MiB and 10k entries; evict oldest by FIFO with byte tracking.
    • Limit shared-cache persistence to 4 concurrent writes and 256 queued; coalesce by session + tool call and keep only the latest.
    • Clear pending persists on session purge and skip expired entries; keep warming local cache on reads.

Written for commit ea4e865. Summary will update on new commits.

Review in cubic

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.59259% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.39%. Comparing base (df19e6e) to head (ea4e865).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2636      +/-   ##
==========================================
- Coverage   96.40%   96.39%   -0.01%     
==========================================
  Files         600      600              
  Lines       35238    35282      +44     
  Branches     9751     9811      +60     
==========================================
+ Hits        33972    34011      +39     
- Misses        704      709       +5     
  Partials      562      562              
Flag Coverage Δ
backend 95.62% <92.59%> (-0.02%) ⬇️
frontend 97.21% <ø> (ø)
shared 99.43% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant