Skip to content

Allow patching pinned on long-term memories#199

Merged
tylerhutcherson merged 1 commit intomainfrom
fix/pinned-flag-not-editable
Mar 13, 2026
Merged

Allow patching pinned on long-term memories#199
tylerhutcherson merged 1 commit intomainfrom
fix/pinned-flag-not-editable

Conversation

@tylerhutcherson
Copy link
Copy Markdown
Contributor

@tylerhutcherson tylerhutcherson commented Mar 13, 2026

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 pinned flag; behavior is covered by new API/service/MCP regression tests.

Overview
Adds support for editing pinned on existing long-term memories. The PATCH /v1/long-term-memory/{memory_id} update path now allows pinned in the server-side updatable field set and in the EditMemoryRecordRequest model.

Keeps MCP parity by extending edit_long_term_memory to accept/pass through pinned, and adds focused tests covering API patch requests and the underlying update_long_term_memory behavior for pin/unpin.

Written by Cursor Bugbot for commit 851fca1. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings March 13, 2026 19:06
@tylerhutcherson tylerhutcherson added the bug Something isn't working label Mar 13, 2026
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

@jit-ci
Copy link
Copy Markdown

jit-ci bot commented Mar 13, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Copy link
Copy Markdown
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 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 pinned to the editable/updateable fields for long-term memories (MCP tool + core update validation).
  • Extend EditMemoryRecordRequest to accept pinned updates.
  • Add unit/integration tests covering pinned=True/False updates via MCP, API PATCH, and update_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.

Copy link
Copy Markdown
Contributor

@nkanu17 nkanu17 left a comment

Choose a reason for hiding this comment

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

lgtm

@tylerhutcherson tylerhutcherson merged commit 4804961 into main Mar 13, 2026
27 checks passed
@tylerhutcherson tylerhutcherson deleted the fix/pinned-flag-not-editable branch March 13, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PATCH /memories/{id} returns 400 when updating 'pinned' field

3 participants