fix(mcp): validate episode types before queueing - #1638
Open
vismaytiwari wants to merge 2 commits into
Open
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA behalf of myself , e-mail: vismay.t@gmail.com |
vismaytiwari
marked this pull request as ready for review
July 8, 2026 19:43
1 task
Author
|
recheck |
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.
Addresses #1164
Summary
This validates MCP episode type configuration before an episode is added to the background queue.
Previously,
add_memorycould return a queued-success response even whenGraphiti.add_episodewould immediately reject the configured entity types. The queue worker then logged the failure later, so callers only saw success while the episode was never processed.This reuses Graphiti's existing entity-type and excluded-entity-type validators in
QueueService.add_episode, before creating the background task. Invalid reserved fields such asDataObject.attributesnow fail before queueing, so the MCP tool returns an error instead of a false success message.Validation
QueueService.add_episodereturned a queue position, then the worker loggedattributes cannot be used as an attribute for DataObject as it is a protected attribute name.add_memorynow returns an error response for that case and does not create a queue.uv run pytest tests/test_core_parity.py -qfrommcp_server: 28 passed.uv run ruff check src/services/queue_service.py tests/test_core_parity.py: passed.uv run ruff format --check src/services/queue_service.py tests/test_core_parity.py: passed.uv run pyright src/services/queue_service.py: 0 errors.Note: I also tried MCP-wide
uv run pyright src tests, but it currently reports existing unrelated MCP test/import typing issues, so I kept the pyright check scoped to the changed service file.