Repository navigation
Python: preserve custom memory topic slugs on reload - #9153
Open
Kunyan (Kunyanli230) wants to merge 1 commit into
Open
Kunyan (Kunyanli230) wants to merge 1 commit into
Kunyan (Kunyanli230) wants to merge 1 commit into
Conversation
Kunyan (Kunyanli230)
requested review from
SergeyMenshykh,
Tao Chen (TaoChenOSU),
Eduard van Valkenburg (eavanvalkenburg),
Giles Odigwe (giles17),
Jose Alvarez (jpalvarezl),
Evan Mattson (moonbox3),
Roger Barreto (rogerbarreto),
sophia-ramsey and
westey (westey-m)
as code owners
October 7, 2026 14:29
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation correctly preserves filename identity and includes appropriate regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Preserves custom memory topic slugs when file-backed records are reloaded.
Changes:
- Restores topic slugs from filenames during reads.
- Adds reload, update, indexing, and context-injection coverage.
| File | Description |
|---|---|
python/packages/core/agent_framework/_harness/_memory.py |
Derives reloaded record slugs from file stems. |
python/packages/core/tests/core/test_harness_memory.py |
Tests custom-slug persistence and loading. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Author
@microsoft-github-policy-service agree |
This branch was successfully deployed
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.
Motivation & Context
A memory topic with
topic="Preferred Tools"andslug="tools"is saved astools.md, but reloading it derivespreferred-toolsfrom the heading. The rebuilt index then points to a missing file, andMemoryContextProvider.before_run()raisesFileNotFoundErrorwhen selecting the memory.Description & Review Guide
Three of the four regression cases fail on the base revision; all four pass with the fix. The full core unit suite passed 8,385 tests (21 skipped, 2 xfailed, 46 warnings). Source Pyright, all five test type checkers, Ruff, formatting, pre-commit hooks, and the core sdist/wheel build passed. Integration tests were not run.
Related Issue
Pending a tracking issue.
Contribution Checklist