Skip to content

♻️ fix: Prevent Instructions from Removal when nearing Max Context #5516

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

Merged
merged 5 commits into from
Jan 28, 2025

Conversation

danny-avila
Copy link
Owner

@danny-avila danny-avila commented Jan 28, 2025

Summary

Closes #5466

  • Always included instructions in the payload if provided, ensuring consistent context handling
  • Refactored getMessagesWithinTokenLimit to accept a params object for improved clarity
  • Added tests in BaseClient.test.js to verify instruction inclusion

Other Changes

  • Modified the LogoutController to pass the request object correctly and clear the refresh token cookie
  • Updated logoutUser in AuthService to accept the request object and handle session destruction

Change Type

  • Bug fix

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

@danny-avila danny-avila merged commit 4110209 into main Jan 28, 2025
2 checks passed
@danny-avila danny-avila deleted the fix/instructions-context branch January 28, 2025 01:37
justinmdickey pushed a commit to e-gineering/LibreChat that referenced this pull request Jan 30, 2025
…anny-avila#5516)

* refactor: getMessagesWithinTokenLimit to accept params object

* refactor: always include instructions in payload if provided

* ci: remove obsolete test

* refactor: update logoutUser to accept request object and handle session destruction

* test: enhance getMessagesWithinTokenLimit tests for instruction handling
justinmdickey pushed a commit to e-gineering/LibreChat that referenced this pull request Feb 7, 2025
…anny-avila#5516)

* refactor: getMessagesWithinTokenLimit to accept params object

* refactor: always include instructions in payload if provided

* ci: remove obsolete test

* refactor: update logoutUser to accept request object and handle session destruction

* test: enhance getMessagesWithinTokenLimit tests for instruction handling
danny-avila added a commit that referenced this pull request Mar 27, 2025
…5516)

* refactor: getMessagesWithinTokenLimit to accept params object

* refactor: always include instructions in payload if provided

* ci: remove obsolete test

* refactor: update logoutUser to accept request object and handle session destruction

* test: enhance getMessagesWithinTokenLimit tests for instruction handling
MichielMAnalytics pushed a commit to MichielMAnalytics/ProAI that referenced this pull request Jun 6, 2025
…anny-avila#5516)

* refactor: getMessagesWithinTokenLimit to accept params object

* refactor: always include instructions in payload if provided

* ci: remove obsolete test

* refactor: update logoutUser to accept request object and handle session destruction

* test: enhance getMessagesWithinTokenLimit tests for instruction handling
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.

[Bug]: The promptPrefix (system message) seems to get truncated when conversation exceeds the context limit.
1 participant