Skip to content

fix(compaction): persist serialized tail separately#27002

Closed
rekram1-node wants to merge 6 commits into
devfrom
fix-aws-issue
Closed

fix(compaction): persist serialized tail separately#27002
rekram1-node wants to merge 6 commits into
devfrom
fix-aws-issue

Conversation

@rekram1-node
Copy link
Copy Markdown
Collaborator

@rekram1-node rekram1-node commented May 12, 2026

Closes: #14332

Summary

  • Restores the compaction summarization request to only include the selected head history.
  • Serializes the preserved recent tail into a separate synthetic user message after the generated summary.
  • Marks that synthetic tail so the prompt loop does not treat it as a new user request.

Context

This fixes a regression introduced by #26830. That change correctly moved away from replaying raw retained tail messages, but it also folded the serialized tail into the summarization request itself. As a result, recent tail content influenced summary generation instead of being persisted as post-compaction conversation context.

The corrected flow keeps the summarization request unchanged, saves the model-generated summary as-is, and stores the serialized tail separately for future context.

Testing

  • bun test test/session/compaction.test.ts

@rekram1-node
Copy link
Copy Markdown
Collaborator Author

/review

Comment thread packages/opencode/src/session/compaction.ts
@rekram1-node
Copy link
Copy Markdown
Collaborator Author

/review

Comment thread packages/opencode/test/session/compaction.test.ts Outdated
@rekram1-node
Copy link
Copy Markdown
Collaborator Author

/review

Comment thread packages/opencode/src/session/compaction.ts
@rekram1-node
Copy link
Copy Markdown
Collaborator Author

/review

@github-actions
Copy link
Copy Markdown
Contributor

lgtm

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.

Amazon Bedrock Opus 4.6 compaction failure

1 participant