fix(opencode): stop storing full patch text in session summary diffs - #40861
fix(opencode): stop storing full patch text in session summary diffs#40861KirillDeviatka wants to merge 4 commits into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Potential Related PRs Found:
Note: The PR description also references earlier attempts (#32410 and #33892 that were auto-closed) and the original issue #32005, which suggests this is a revisited fix for a known problem with session diff storage payload sizes. |
Persist only file/status/additions/deletions on the user message. Full patches stay reconstructable via SessionSummary.diff()/computeDiff(). Also drop common vendor/.node-runtime paths from durable summaries. Fixes anomalyco#32005 Co-authored-by: Cursor <cursoragent@cursor.com>
db438a4 to
0ff0ad8
Compare
Add size-bound, Windows path, and no-patch cases for compactSummaryDiffs. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Local verification after updating onto latest Expanded |
Issue for this PR
Fixes #32005
Related: #17622, #20990 (and earlier attempts #32410 / #33892 that were auto-closed)
Type of change
What does this PR do?
SessionSummary.summarize()previously stored the fullSnapshot.diffFull()result — including completepatchtext — onusermessage.summary.diffs. That payload is written into an append-onlymessage.updated.1event log on every step-finish, so a multi-step turn that touches large files can grow theeventtable by multiple GB and OOM/Jetsam on reopen.This change:
file,status,additions,deletions) in durable summariesnode_modules/,.node-runtime/) from durable summariesSessionSummary.diff()recompute full patches on demand from snapshots (with legacy stored-metadata fallback)Complementary to open #40821 (scope summary to session-touched files). This PR focuses on payload size, not path scoping.
How did you verify your code works?
bun test test/session/summary-diffs.test.ts— PASS (strip patch; drop vendor/.node-runtime)Checklist