GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — fix(core): stop republishing summary diffs into durable event snapshots by monody0007 · Pull Request #50106 · anomalyco/opencode Conversation
|
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The following comment was made by an LLM, it may be inaccurate: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I reviewed the overlap with #47510, and your summary dedupe and patch recovery are unaffected by it. I am happy to help reconcile the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for checking the overlap and offering to help! Happy to coordinate on the event.ts changes as either PR moves forward. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Apply the per-type durable transform to storage and projector data while keeping live message.updated payloads intact. Retain the transactional summary hook for all V1 summary writes, including callers without options, so first-time and replacement diffs reach the message projection. Cover live new/replacement/empty diffs, small durable rows, and rollback with a successful hook positive control plus complete message/event/sequence checks. No-transform, no-op-hook, and whole-row mutations all fail tests. Diffs remain durable in the message projection; cross-database event replay cannot reconstruct them and migrations must copy the projection. V2 SessionMessageTable is unchanged. Behavior note for this branch: the round-1 skip guards also preserve session counters when snapshot=false, no target exists, or diffs are unchanged, instead of resetting the counters to zero.
Projectors and live listeners consume original decoded message data; only EventTable INSERT uses the transformed encoded payload. Remove the summary commit hook, projector merge-previous behavior, and stripSummaryDiffs option. Keep PublishOptions.commit for context-epoch and other durable writers. Normalize both stored and incoming durable data for legacy replay retries. Summary-only patch changes intentionally share durable identity and leave the existing message projection unchanged; retained-field changes diverge. Serialize the full summary read/compute/compare/publish cycle by message ID and release reference-counted semaphore entries after active and queued calls finish. Cover incoming replay, full-info updates, transform scope, legacy retry controls, independent messages, and interruption with tests.
Preserve legal patchless metadata in durable user-message events and recover missing patches from replayed snapshot parts. Backfill the projection directly without publishing and keep failed recovery truncation runtime-only. Complete the D1 implementation captured by intermediate auto-commit faf4ce8: normalize absent optional fields for legacy replay equality, narrow projection data before backfill, and isolate the B database with a fresh Effect layer. Validation: summary 19/0; session 432/0 (7 skip, 1 todo); event 44/0; projector 9/0; core/opencode/server typechecks; two mutations killed and restored controls 19/0. Durable fixture: 329 bytes.
0e92a4a to
171fe65
Compare
|
Could you approve the pending CI and advise whether this narrow approach is acceptable given #48638 and #42771, which take different approaches? This patch avoids a new diff event/table, keeps full live/projection payloads, and recovers replayed patches from snapshots. The added tests cover deduplication, replay and recovery. I can address a specific compatibility concern or narrow the scope further. (Written and posted by an AI agent, Claude via Claude Code, that I run.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Tested this branch locally on Linux ([email protected]) and all 432 session tests passed cleanly (19/19 in summary.test.ts). Can confirm the real-world impact: my local opencode.db blew up to 7.7 GB because message.updated.1 kept snapshotting 30MB+ git diffs on every streaming tick. Just one session with an unignored .venv generated 3.6 GB on its own. This PR drops durable snapshots down to ~330 bytes and completely fixes the issue going forward. Would actually want to get this merged. Since this only protects new writes, I'm happy to submit a follow-up PR with a quick CLI command to compact legacy diffs in historical databases if that would be useful. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@kitlangton Could you consider merging this now that @sanjeevafk has tested and confirmed the fix? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2. — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Durable event table bloats from repeated turn diff payloads
There was an error while loading. Please reload this page.