-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: include first message in condense summarization #8294
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,8 +103,8 @@ export async function summarizeConversation( | |
|
|
||
| // Always preserve the first message (which may contain slash command content) | ||
| const firstMessage = messages[0] | ||
| // Get messages to summarize, excluding the first message and last N messages | ||
| const messagesToSummarize = getMessagesSinceLastSummary(messages.slice(1, -N_MESSAGES_TO_KEEP)) | ||
| // Get messages to summarize, including the first message but excluding last N messages | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: If N_MESSAGES_TO_KEEP === 0, |
||
| const messagesToSummarize = getMessagesSinceLastSummary(messages.slice(0, -N_MESSAGES_TO_KEEP)) | ||
|
|
||
| if (messagesToSummarize.length <= 1) { | ||
| const error = | ||
|
|
||
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.
P2: This test override uses
Anthropic.Messages.MessageParam[], coupling the test to a specific provider SDK. Prefer a provider-agnostic message type to reduce brittleness across providers.