Skip to content

Conversation

danny-avila
Copy link
Owner

Summary

I fixed a bug where setting memory.disabled: true in librechat.yaml had no effect on the UI, allowing memory functionality to remain visible and accessible in the sidepanel despite being explicitly disabled.

  • Fixed the permission system in packages/api/src/app/permissions.ts to properly detect when memory is explicitly disabled via configuration
  • Added logic to set all memory-related permissions (USE, CREATE, READ, UPDATE, OPT_OUT) to false when memory.disabled: true
  • Enhanced the permission system to include all memory permissions defined in role defaults, not just a subset
  • Updated existing unit tests to reflect the correct behavior where all memory permissions are properly handled
  • Added comprehensive test cases to verify memory permissions are completely disabled when memory is explicitly disabled
  • Added test case to verify memory permissions work correctly when memory is enabled with proper agent configuration
  • Removed mocking of isMemoryEnabled function in tests to use the actual implementation for more accurate testing

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

I tested the fix by implementing comprehensive unit tests that verify the memory permission system works correctly in both disabled and enabled states. The tests confirm that when memory.disabled: true is set in the configuration, all memory-related permissions are set to false, which prevents the memory functionality from appearing in the UI sidepanel.

Test Configuration:

  • Jest test suite with 16 test cases covering various permission scenarios
  • Tests verify memory permissions for both USER and ADMIN roles
  • Tests confirm memory functionality is completely disabled when memory.disabled: true
  • Tests verify memory functionality works correctly when properly configured with agent settings

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
  • 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 linked an issue Sep 9, 2025 that may be closed by this pull request
1 task
@danny-avila danny-avila merged commit 588e0c4 into dev Sep 9, 2025
1 of 2 checks passed
@danny-avila danny-avila deleted the fix/memory-config branch September 9, 2025 13:14
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]: Cant disable memory capabilitiy
1 participant