Skip to content

Conversation

@mrubens
Copy link
Collaborator

@mrubens mrubens commented Dec 30, 2024

Attempt to fix the issue where long messages overflow the context window, leaving the user stuck.


Important

Introduces ContextWindow class to manage message sizes in Cline, with tests for validation and truncation logic.

  • Behavior:
    • Introduces ContextWindow class in ContextWindow.ts to manage message size and context window limits.
    • Updates Cline class in Cline.ts to use ContextWindow for message size validation and history truncation.
    • Handles large messages by checking if they exceed the context window and prompts user to retry if necessary.
  • Testing:
    • Adds ContextWindow.test.ts to test message size calculation, validation, and history truncation logic.
    • Tests various scenarios including different model configurations and token types.

This description was created by Ellipsis for 4ea817bd67023e8474936a051bd46f559b8c38e9. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Dec 30, 2024

⚠️ No Changeset found

Latest commit: 357f0e0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mrubens mrubens marked this pull request as draft December 30, 2024 09:04
@mrubens mrubens force-pushed the fix_sliding_window branch 2 times, most recently from 174c357 to f561b7a Compare December 30, 2024 19:07
@mrubens
Copy link
Collaborator Author

mrubens commented Dec 31, 2024

Closed in favor of #251

@mrubens mrubens closed this Dec 31, 2024
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.

2 participants