| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Factor the compaction filter into an incremental scan and have filterCompactedEffect page backward through messages, stopping as soon as a completed compaction boundary (and any retained tail) is found, instead of hydrating the entire session history first. Ported from anomalyco#31638 (already Effect-based; applied as-is). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Factor the compaction filter into an incremental scan and have filterCompactedEffect page backward through messages, stopping as soon as a completed compaction boundary (and any retained tail) is found, instead of hydrating the entire session history first. Ported from anomalyco#31638 (already Effect-based; applied as-is). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Factor the compaction filter into an incremental scan and have filterCompactedEffect page backward through messages, stopping as soon as a completed compaction boundary (and any retained tail) is found, instead of hydrating the entire session history first. Ported from anomalyco#31638 (already Effect-based; applied as-is). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Factor the compaction filter into an incremental scan and have filterCompactedEffect page backward through messages, stopping as soon as a completed compaction boundary (and any retained tail) is found, instead of hydrating the entire session history first. Ported from anomalyco#31638 (already Effect-based; applied as-is). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Factor the compaction filter into an incremental scan and have filterCompactedEffect page backward through messages, stopping as soon as a completed compaction boundary (and any retained tail) is found, instead of hydrating the entire session history first. Ported from anomalyco#31638 (already Effect-based; applied as-is). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Factor the compaction filter into an incremental scan and have filterCompactedEffect page backward through messages, stopping as soon as a completed compaction boundary (and any retained tail) is found, instead of hydrating the entire session history first. Ported from anomalyco#31638 (already Effect-based; applied as-is). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Cross-linking: PR #39930 (brauliobo, July 31) implements the same fix for the same function (filterCompactedEffect), with a leaner approach worth considering before merging either:
Recommendation: consolidate on #39930 (or port its messageRows-first walk into #31638's shared scan-state structure — that combination is the best of both). Having both open means one will likely be closed as a duplicate by the maintainers anyway. |
Sorry, something went wrong.
Upstream PR anomalyco#39930 by @brauliobo, ported onto current dev. Finds the compaction boundary from lightweight message rows first, then hydrates only the retained messages, so oversized parts on the boundary page are never hydrated. Supersedes upstream PR anomalyco#31638 by @ualtinok, which this branch previously carried. The two are competing rewrites of the same function and conflict. Verified 2026-08-28: anomalyco#31638's full pagination test file passes against this implementation, while this PR's boundary-hydration test fails against anomalyco#31638's. Co-authored-by: Braulio Oliveira <brauliobo@gmail.com>
| Back | FazBrowse Home | New Git URL |
Issue for this PR
Closes #22208
Related: #31525, #25366, #24841, #31527
Type of change
What does this PR do?
MessageV2.filterCompactedEffect(sessionID) used to stream the entire session history, then discard messages before the latest completed compaction boundary.
This changes the DB-backed path to page newest-first and stop once the compacted boundary has been found. The in-memory filterCompacted(...) behavior is kept shared through the same scan state, so the returned message list stays equivalent without hydrating pre-compaction history from the database.
Unlike #31527, this does not cache messages across prompt-loop iterations. It only reduces the amount of history loaded for already-compacted sessions.
How did you verify your code works?
Screenshots / recordings
N/A — backend performance fix.
Checklist