Skip to content

fix(memory): reject empty entity IDs during deletion - #613

Open
krishna28004 wants to merge 1 commit into
MemoriLabs:mainfrom
krishna28004:pr5-planning
Open

fix(memory): reject empty entity IDs during deletion#613
krishna28004 wants to merge 1 commit into
MemoriLabs:mainfrom
krishna28004:pr5-planning

Conversation

@krishna28004

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes a data-loss edge case in delete_entity_memories() where passing an empty string ("") could incorrectly fall back to the configured default entity due to Python truthiness.

Related issue

N/A

Before opening this PR

  • I have checked that there is not already an open PR for this change.
  • I have checked existing issues and discussions for relevant context.
  • I have read the contributing guidelines.

Affected components

  • Python SDK (memori/)
  • Memory augmentation or recall

How was this tested?

  • uv run pytest
  • uv run ruff check .
  • uv run ruff format --check .

Checklist

  • I have kept this change focused and consistent with the existing architecture.
  • I have added or updated tests where appropriate.
  • I have updated documentation or examples for user-facing changes.
  • This PR does not require live API keys for unit tests.
  • This PR does not include generated artifacts, local databases, or cache files.
  • I have called out any breaking changes, migration steps, or compatibility concerns below.

Notes for reviewers

This PR adds an explicit validation for empty entity IDs at the public API boundary and replaces the internal truthiness fallback with an explicit is not None check. A regression test has been added to prevent the data-loss scenario from recurring.

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.

1 participant