Claude
|
f33aaa82bb
|
Fix: Priority 1 & 2 code review fixes for graph exploration tools
Priority 1 (Critical):
- Fix NULL handling in get_entity_timeline sort using datetime.min fallback
- Add UUID validation to both get_entity_connections and get_entity_timeline
- Add comprehensive automated integration tests (test_graph_exploration_int.py)
Priority 2 (Important):
- Improve exception handling with specific Neo4jError, ValueError, AttributeError
- Add performance limitation documentation to tool docstrings
- Generalize coaching references to technical/research examples
Technical Details:
- Import datetime and UUID for validation/sorting
- Import Neo4jError for specific exception handling
- Validate entity_uuid format before database calls
- Handle None values in chronological sort with datetime.min
- Add exc_info=True to error logging for better debugging
- Sanitize error messages to avoid exposing internal details
Test Coverage:
- Tool availability verification
- Invalid UUID validation
- Nonexistent entity handling
- Real data flow (add → search → explore)
- Max limits parameter testing
- Chronological ordering verification
Performance Notes Added:
- Document fetching behavior (database → application filtering)
- Warn about high-degree nodes (1000+ connections/episodes)
- Recommend smaller limits for large result sets
All changes maintain backward compatibility and follow existing code patterns.
Refs: mcp_server/src/graphiti_mcp_server.py:1560,1656
|
2025-11-15 10:12:22 +00:00 |
|