-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Sliding window fix #1162
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
Sliding window fix #1162
Conversation
|
| import { ModelInfo } from "../../../shared/api" | ||
| import { truncateConversation, truncateConversationIfNeeded } from "../index" | ||
|
|
||
| describe("truncateConversation", () => { |
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 tests for empty messages array to ensure truncate functions handle such edge cases gracefully.
Description
Fix truncation logic for models with
maxTokensvalues above 40K (like Claude 3.7 Sonnet).Type of change
How Has This Been Tested?
Checklist:
Additional context
Related Issues
Reviewers
Important
Fixes sliding window logic in
truncateConversationfunctions and adds tests for message truncation and token threshold handling.truncateConversation()andtruncateConversationIfNeeded()inindex.tsto correctly handle message truncation based on fraction and model context.getMaxTokensForPromptCachingModels()andgetMaxTokensForNonPromptCachingModels()to usemodelInfo.maxTokensif available.sliding-window.test.tsfortruncateConversation()to verify message retention and removal logic.truncateConversationIfNeeded()to check token threshold handling for different model configurations.anthropic/claude-3.7-sonnet:betamodel ID inClineProvider.ts.This description was created by
for 6245aa7. It will automatically update as commits are pushed.