Allow patching pinned on long-term memories#199
Merged
tylerhutcherson merged 1 commit intomainfrom Mar 13, 2026
Merged
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends long-term memory editing to support updating the pinned flag (used to protect memories from auto-deletion), and adds regression tests to ensure the flag is correctly passed through MCP, API, and storage update layers.
Changes:
- Add
pinnedto the editable/updateable fields for long-term memories (MCP tool + core update validation). - Extend
EditMemoryRecordRequestto acceptpinnedupdates. - Add unit/integration tests covering
pinned=True/Falseupdates via MCP, API PATCH, andupdate_long_term_memory.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_mcp.py | Adds MCP regression test ensuring edit_long_term_memory forwards pinned into the core update call. |
| tests/test_long_term_memory.py | Adds unit tests verifying update_long_term_memory persists pinned changes to the vector DB adapter. |
| tests/test_api.py | Adds API PATCH tests ensuring pinned can be patched alone or with other editable fields. |
| agent_memory_server/models.py | Adds pinned to EditMemoryRecordRequest so API/MCP update payloads can include it. |
| agent_memory_server/mcp.py | Adds pinned parameter to the MCP edit_long_term_memory tool and forwards it into the update request. |
| agent_memory_server/long_term_memory.py | Allows pinned in the update_long_term_memory updatable-fields allowlist. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Enables editing pinned on existing long-term memories via
PATCH /v1/long-term-memory/{memory_id}This adds pinned to the edit request model, allows it in the server update path, keeps MCP edit parity, and adds focused regression tests for API, service, and MCP behavior.
Fixes #175
Note
Low Risk
Low risk, additive change that only extends the long-term memory edit path to accept an optional
pinnedflag; behavior is covered by new API/service/MCP regression tests.Overview
Adds support for editing
pinnedon existing long-term memories. ThePATCH /v1/long-term-memory/{memory_id}update path now allowspinnedin the server-side updatable field set and in theEditMemoryRecordRequestmodel.Keeps MCP parity by extending
edit_long_term_memoryto accept/pass throughpinned, and adds focused tests covering API patch requests and the underlyingupdate_long_term_memorybehavior for pin/unpin.Written by Cursor Bugbot for commit 851fca1. This will update automatically on new commits. Configure here.