fix(chatd): improve compaction prompt to preserve forward momentum#22989
Merged
Conversation
The previous summarization prompt told the model to "omit next-step
suggestions," and the summary prefix framed compacted context as
passive history ("Summary of earlier chat context"). This caused the
model to lose direction mid-task after compaction — it would read a
factual recap with no forward momentum and stop or ask the user what
to do next.
The new prompt:
- Removes the "omit next-step suggestions" instruction
- Explicitly asks for in-progress and remaining work
- Captures the specific action being performed when compaction fired
- Frames the summary prefix as an active handoff with a "Continue"
directive
This aligns with patterns used by Codex, Mux, Continue, and Copilot
Chat, all of which preserve forward intent through compaction.
mattvollmer
approved these changes
Mar 12, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
The summarization prompt explicitly tells the model to "Omit pleasantries and next-step suggestions" and the summary prefix frames the compacted context as passive history:
Summary of earlier chat context:. After compaction mid-task, the model reads a factual recap with no forward momentum, loses its direction, and either stops or asks the user what to do.Research
I compared our compaction prompt against several other agents:
Every other major agent explicitly preserves forward intent and in-progress state. Coder was the only one telling the model to omit next steps.
Changes
Summary prompt:
Omit next-step suggestionsInclude:list with explicit items for in-progress work, remaining work, and the specific action being performed when compaction firedcontext compaction(matching Codex's framing)Summary prefix:
Summary of earlier chat context:The following is a summary of the earlier conversation. The assistant was actively working when the context was compacted. Continue the work described below:The prefix is the first thing the model reads post-compaction — framing it as an active handoff with an explicit "Continue" directive primes the model to resume work rather than wait.