Skip to content

fix: reconstruct compression state after fork and compaction - #589

Open
omri1100 wants to merge 1 commit into
Opencode-DCP:masterfrom
omri1100:fix/reconstruct-compression-on-fork-and-compaction
Open

fix: reconstruct compression state after fork and compaction#589
omri1100 wants to merge 1 commit into
Opencode-DCP:masterfrom
omri1100:fix/reconstruct-compression-on-fork-and-compaction

Conversation

@omri1100

Copy link
Copy Markdown

When a session is forked or compacted, DCP loses all compression state because the new session has no persisted state file (fork) or state is wiped (compaction). This causes previously compressed messages to leak back into context, blowing up the context window.

This fix detects sessions that have compress tool results in their conversation history but no persisted compression state, and reconstructs the compression blocks by replaying the compress tool results in chronological order.

Fixes #457, #521

When a session is forked or compacted, DCP loses all compression state
because the new session has no persisted state file (fork) or state is
wiped (compaction). This causes previously compressed messages to leak
back into context, blowing up the context window.

This fix detects sessions that have compress tool results in their
conversation history but no persisted compression state, and
reconstructs the compression blocks by replaying the compress tool
results in chronological order.

Fixes Opencode-DCP#457, Opencode-DCP#521
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.

[Bug]: DCP context window may leak pre-fork messages after /fork message (model issue uncertain)

2 participants