Fix for cleared chat history reloaded by stateful cache managers #1076
Merged
pieroit merged 4 commits intocheshire-cat-ai:developfrom May 12, 2025
Merged
Fix for cleared chat history reloaded by stateful cache managers #1076pieroit merged 4 commits intocheshire-cat-ai:developfrom
pieroit merged 4 commits intocheshire-cat-ai:developfrom
Conversation
…st. If the directory is not cleaned, a second test run fails
7 tasks
Author
|
Gentle ping 😁. Has anyone had a chance to look at this PR? Any feedback? I'm available to help clarify things if needed. Thank you. |
Member
|
Good catch thanks @lucapiccinelli also for taking care of the tests. |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Fix for the issue #1075
From the Cat UI, when using file_system as a cache manager, if you wipe a conversation using HTTP DELETE /conversation_history and then do a browser refresh, the deleted conversation is loaded back from the cache.
The bug was introduced in this commit in the file
websocket.py, commenting the line 48I noticed that this commit also modified the test
test_session_sync_while_websocket_is_openin the filecore/tests/routes/test_session.py. I checked that uncommenting the line 48 inwebsocket.pywas not breaking it. It doesn't.Related to tests,
test_cache_creationincore/tests/cache/test_core_caches.pywas failing on a second test run. This happens also in the main branch, due to a dirty context issue. I then added a try/finally block to clear the context and fix the test.Type of change
Checklist: