Skip to content

fix(compaction): use neutral text for compaction replay message#13940

Open
leohenon wants to merge 1 commit intoanomalyco:devfrom
leohenon:fix/compaction-user-message
Open

fix(compaction): use neutral text for compaction replay message#13940
leohenon wants to merge 1 commit intoanomalyco:devfrom
leohenon:fix/compaction-user-message

Conversation

@leohenon
Copy link

What does this PR do?

Closes #13838

Compaction injects What did we do so far? as a user message. The model treats this as a real request and sometimes generates an unwanted summary.

Changed the text to [Compacted].

How did you verify your code works?

Updated test in message-v2.test.ts and verified manually.

Copilot AI review requested due to automatic review settings February 17, 2026 06:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an issue where compaction replay injected a synthetic user prompt (“What did we do so far?”) that could trigger unintended model summaries, replacing it with a neutral marker.

Changes:

  • Replaced the compaction replay injected user text with "[Compacted]".
  • Updated the corresponding unit test expectation in message-v2.test.ts.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/opencode/src/session/message-v2.ts Updates the synthetic compaction text injected into user model messages to a neutral marker.
packages/opencode/test/session/message-v2.test.ts Updates test expectations to match the new injected compaction marker text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Compaction replay injects fake user message "What did we do so far?" causing unwanted summary generation

1 participant