Repository navigation
Conversation
After a compaction Claude Code keeps the earlier rows in the file before the `compact_boundary` and writes the summary as a user row flagged `isCompactSummary`. Reading in file order already carries that history, so the summary became a user turn that repeated it. It now stays in the native body only. Fixes skillsynchq#100
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #100
What changed and why?
After a compaction, the file still holds the earlier conversation before the
compact_boundary, and the summary is auserrow flaggedisCompactSummary. txcript reads in file order, so the history was already in Common and the summary added it again, condensed, as a user turn between two real prompts.Before (
to_commonon a compacted transcript):first prompt,summary,second prompt.After:
first prompt,second prompt. The summary row stays in the native body, so a native round trip is unchanged.is_compact_summaryinsrc/harness/claude_code.rsskips that row inrecords_to_messages(shared with Cowork).isMetarows are left as they are, sincedocs/formats/cowork.mddocuments them as context the model saw.Test:
the_compaction_summary_is_not_a_user_turnintests/integration/claude_code.rs, red onmainand green with the fix.cargo fmt --check,cargo clippy --all-targetswith-D warningsandcargo test -p txcript(featuresopencode,hermes,search,codex_zstd) pass. The format doc and the changelog are updated.