Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands type checking coverage by adding ty (type checker) to the tests directory. The changes modernize test code to satisfy strict type checking requirements while maintaining functional equivalence.
Changes:
- Updated test files to use explicit type annotations and type-safe patterns
- Replaced Pydantic model direct instantiation with
model_validate()calls - Added runtime type assertions and casts to clarify variable types
- Modified mock objects to satisfy type checker requirements
Reviewed changes
Copilot reviewed 46 out of 46 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/lint.yml | Extended ty check to include tests directory |
| tests/memmachine/server/test_middleware.py | Added cast for middleware type compatibility |
| tests/memmachine/server/api_v2/test_spec.py | Replaced direct Pydantic instantiation with model_validate |
| tests/memmachine/server/api_v2/test_router.py | Added type casts and updated model instantiation |
| tests/memmachine/server/api_v2/test_mcp.py | Updated SearchResult instantiation |
| tests/memmachine/server/api_v2/test_config_service.py | Replaced spec constructors with model_validate |
| tests/memmachine/semantic_memory/test_semantic_session_manager.py | Added assertions and list conversions for async generators |
| tests/memmachine/semantic_memory/test_semantic_model.py | Added assertion for citations field |
| tests/memmachine/semantic_memory/test_semantic_memory_integration.py | Added cast for ResourceManager and list conversion |
| tests/memmachine/semantic_memory/test_semantic_llm.py | Updated type annotations for mock fixtures |
| tests/memmachine/semantic_memory/test_semantic_ingestion.py | Added SemanticCommandType enum usage and casts |
| tests/memmachine/semantic_memory/storage/test_semantic_storage.py | Added type annotations and assertions |
| tests/memmachine/semantic_memory/storage/alembic_pg/test_sqlalchemy_vs_alembic.py | Added string conversions and improved index handling |
| tests/memmachine/semantic_memory/storage/alembic_pg/test_set_id_migration.py | Added assertion for module file path |
| tests/memmachine/semantic_memory/mock_semantic_memory_objects.py | Updated type signatures to match base class |
| tests/memmachine/semantic_memory/conftest.py | Fixed parameter name typo |
| tests/memmachine/rest_client/test_memory.py | Added type ignore comments and casts |
| tests/memmachine/rest_client/test_langgraph.py | Updated function call signatures |
| tests/memmachine/rest_client/test_config.py | Updated spec instantiation |
| tests/memmachine/rest_client/test_client.py | Added casts for session mocking |
| tests/memmachine/main/test_memmachine_mock.py | Added properties to DummySessionData |
| tests/memmachine/main/test_memmachine_integration.py | Added session_key property and list conversion |
| tests/memmachine/main/test_memachine.py | Added assertions and list conversions |
| tests/memmachine/installation/test_memmachine_configure.py | Extracted environment to local variable |
| tests/memmachine/installation/test_configuration_wizard.py | Added assertions for optional fields |
| tests/memmachine/episodic_memory/test_episodic_memory_manager.py | Removed unused global declaration |
| tests/memmachine/episodic_memory/test_episodic_memory.py | Updated Episode creation with type annotation |
| tests/memmachine/episodic_memory/short_term_memory/test_short_term_memory.py | Fixed parameter names and type annotations |
| tests/memmachine/episodic_memory/long_term_memory/test_long_term_memory.py | Fixed metadata field names and removed duplicate parameter |
| tests/memmachine/episodic_memory/declarative_memory/test_declarative_memory.py | Removed duplicate parameter |
| tests/memmachine/common/test_utils.py | Added type ignore comment |
| tests/memmachine/common/session_manager/test_session_manager.py | Removed unused global declaration |
| tests/memmachine/common/resource_manager/test_reranker_manager.py | Implemented complete FakeEmbedder and added casts |
| tests/memmachine/common/resource_manager/test_database_manager.py | Added casts for internal method mocking |
| tests/memmachine/common/language_model/test_openai_responses_language_model.py | Added httpx.Request for APITimeoutError |
| tests/memmachine/common/language_model/test_openai_chat_completions_language_model.py | Replaced mock tool call with proper factory function |
| tests/memmachine/common/episode_store/test_episode_storage.py | Added JsonValue type and assertions |
| tests/memmachine/common/episode_store/test_count_caching_episode_storage.py | Updated to use EpisodeEntry |
| tests/memmachine/common/configuration/test_semantic_conf.py | Added type annotation |
| tests/memmachine/common/configuration/test_reranker_conf.py | Simplified configuration dict structure |
| tests/memmachine/common/configuration/test_mixin_confs.py | Added assertions for optional credentials |
| tests/memmachine/common/configuration/test_language_model_conf.py | Added type annotations |
| tests/memmachine/common/configuration/test_episodic_config.py | Added assertion |
| tests/memmachine/common/configuration/test_embedder_conf.py | Simplified OpenAI embedder instantiation |
| tests/memmachine/common/configuration/test_configuration.py | Added assertions |
| src/memmachine/semantic_memory/storage/storage_base.py | Added backend_name class attribute |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/memmachine/episodic_memory/long_term_memory/test_long_term_memory.py
Show resolved
Hide resolved
tests/memmachine/episodic_memory/short_term_memory/test_short_term_memory.py
Show resolved
Hide resolved
tests/memmachine/episodic_memory/short_term_memory/test_short_term_memory.py
Show resolved
Hide resolved
tests/memmachine/episodic_memory/long_term_memory/test_long_term_memory.py
Show resolved
Hide resolved
jealous
approved these changes
Feb 2, 2026
sscargal
requested changes
Feb 3, 2026
Contributor
sscargal
left a comment
There was a problem hiding this comment.
Please resolve the ruff check failures for a few of the unit tests. Thanks.
edwinyyyu
approved these changes
Feb 3, 2026
edwinyyyu
reviewed
Feb 3, 2026
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.
Improve test integrity by expanding
tyto cover thetestsdirectory