mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

Fix: remove credential filters to fix opensearch client calls (#3580)

Open Harjotsinghh opened this issue 1 month ago • 1 comments

Description

This change is to fix the bug reported in this issue #3580.

Change summary

After analysing the code i observed that its violating a fundamental software design principles - LSP :

violation : function named _safe_deepcopy_config has a fallback block differently than deepcopy() by removing sensitive fields from the config which breaks opensearch client. Hence deepcopy() cannot be substituted with the the fallback code therefore violating LSP

  • Change 1 - Removed the filtering of the sensitive fields from config in the fallback logic block, making the functional behavior same as the deepcopy() function

Fixes # (#3580)

Type of change

Please delete options that are not relevant.

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

How Has This Been Tested?

Ran the business logic we have that runs mem0 memory integrated with opensearch vector store after making the change to verify the fix.

logs before :

WARNING:opensearch:HEAD https://xx.us-xx-x.aoss.amazonaws.com:443/mem0migrations [status:403 request:0.896s]
ERROR:xx.xx.xx.base:Failed to initialize memory backend: AuthorizationException(403, '')

logs after fix :

INFO:opensearch:HEAD https://xx.xx-xx-1.aoss.amazonaws.com:443/mem0migrations [status:200 request:0.257s]
INFO:opensearch:POST https://xx.xx-xx-1.aoss.amazonaws.com:443/mem0migrations/_search [status:200 request:0.529s]
  • [x] Unit Test

Checklist:

  • [x ] My code follows the style guidelines of this project
  • [ x] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [x ] My changes generate no new warnings
  • [ x] I have added tests that prove my fix is effective or that my feature works
  • [x ] New and existing unit tests pass locally with my changes
  • [ ] Any dependent changes have been merged and published in downstream modules
  • [x ] I have checked my code and corrected any misspellings

Maintainer Checklist

  • [ x] closes #3580 (Replace xxxx with the GitHub issue number)
  • [x ] Made sure Checks passed

Harjotsinghh avatar Oct 16 '25 11:10 Harjotsinghh

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 16 '25 11:10 CLAassistant