Skip to content

Conversation

@abrookins
Copy link
Collaborator

Clean up some duplication after a larger refactor.

Copilot AI review requested due to automatic review settings June 2, 2025 19:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the old messages.py module by consolidating session-related functions into working_memory.py, updates API endpoints to call the consolidated implementations, and adjusts tests to use the new import paths and enums.

  • Moved list_sessions, get_session_memory, set_session_memory, and delete_session_memory from messages.py into working_memory.py and removed messages.py.
  • Updated api.py to use working_memory.list_sessions and working_memory.get_working_memory for session endpoints.
  • Revised tests to patch against working_memory and switched literal memory types to MemoryTypeEnum.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_messages.py Removed obsolete tests for the old messages module
tests/test_long_term_memory.py Updated patch target from messages.list_sessions to working_memory.list_sessions
tests/test_client_api.py Updated patch target and replaced string memory_type with MemoryTypeEnum
tests/conftest.py Switched MemoryMessage import from messages to models
agent_memory_server/working_memory.py Added list_sessions() and updated get_working_memory() signature
agent_memory_server/messages.py Deleted obsolete module
agent_memory_server/long_term_memory.py Updated import to call working_memory.list_sessions
agent_memory_server/api.py Removed old session endpoints and re-added them using working_memory
Comments suppressed due to low confidence (2)

tests/test_messages.py:1

  • The removal of tests/test_messages.py eliminates direct tests for session memory functions. Consider adding or relocating tests to cover working_memory.list_sessions and working_memory.get_session_memory to maintain coverage.
Entire file removed

agent_memory_server/working_memory.py:25

  • [nitpick] The parameter name redis may be ambiguous. Consider renaming it to redis_client to match other usage in the codebase and clarify its purpose.
async def list_sessions(

@abrookins abrookins merged commit fc4914d into main Jun 2, 2025
4 checks passed
@abrookins abrookins deleted the remove-messages-py branch June 2, 2025 19:44
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.

2 participants