-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: include initial ask in condense summarization (#8293) #8298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 fixes a bug in the conversation condensation logic where the initial user ask was excluded from summarization, causing task resumptions to re-answer the original question instead of continuing work. The fix includes the first user message in the summarization input and hardens the prompt to explicitly capture the initial ask.
Key changes:
- Modified message slicing to include the first user message in summarization input
- Enhanced the summary prompt to explicitly require including the initial user ask
- Added test coverage to verify the initial ask is present in summarization input
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/core/condense/index.ts | Changed message slicing logic and hardened summary prompt to include initial user ask |
| src/core/condense/tests/index.spec.ts | Added test to verify initial user message is included in summarization input |
| pr-body.md | Added PR description file |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some issues that need attention:
- Remove pr-body.md (artifact).
- Update outdated comment near messagesToSummarize.
- Consider refining SUMMARY_PROMPT wording.
- Add a test covering presence of earlier summary.
Additional note: typo 'summaryMesage' near countTokens comment should be 'summaryMessage'.
| const mockCallArgs = (maybeRemoveImageBlocks as Mock).mock.calls[0][0] as any[] | ||
| expect(mockCallArgs[mockCallArgs.length - 1]).toEqual(expectedFinalMessage) | ||
| }) | ||
| it("should include the original first user message in summarization input", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a complementary test where an earlier summary exists to assert the original first ask remains present in the summarization input across both manual and automatic condense flows.
…ersation description
Co-authored-by: Copilot <[email protected]>
mrubens
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we lost a newline in the prompt, looks good otherwise
Co-authored-by: Matt Rubens <[email protected]>
Important
Ensure initial user message is included in LLM summarization input and update prompt to capture it in
index.ts.summarizeConversation()inindex.ts.SUMMARY_PROMPTinindex.tsto explicitly require initial user ask inclusion.index.spec.tsto verify initial ask is present in summarization input when no prior summary exists.This description was created by
for e5353cf. You can customize this summary. It will automatically update as commits are pushed.