Skip to content

fix(claude_code): drop the compaction summary from Common - #101

Open
acaprino wants to merge 1 commit into
skillsynchq:mainfrom
acaprino:fix/claude-code-hidden-rows
Open

acaprino wants to merge 1 commit into
skillsynchq:mainfrom
acaprino:fix/claude-code-hidden-rows

Conversation

@acaprino

Copy link
Copy Markdown

Issue: #100

What changed and why?

After a compaction, the file still holds the earlier conversation before the compact_boundary, and the summary is a user row flagged isCompactSummary. 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_common on 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_summary in src/harness/claude_code.rs skips that row in records_to_messages (shared with Cowork). isMeta rows are left as they are, since docs/formats/cowork.md documents them as context the model saw.

Test: the_compaction_summary_is_not_a_user_turn in tests/integration/claude_code.rs, red on main and green with the fix. cargo fmt --check, cargo clippy --all-targets with -D warnings and cargo test -p txcript (features opencode,hermes,search,codex_zstd) pass. The format doc and the changelog are updated.

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

No deployments
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.

1 participant