Python: [Bug]: file memory description sidecars collide for names differing by extension
Observed Behavior
The companion description sidecar for a file memory strips the original extension before appending _description.md, so notes.md and notes share one sidecar notes_description.md. One file's description overwrites the other's, rewriting one file without a description deletes the other's description, and deleting either file removes both.
Expected Behavior
Each memory file owns its own description sidecar, and no write or delete on one file can change another file's description.
Steps to Reproduce
- Through
file_memory_write, savenotes.mdwith descriptionarchitecture. - Save
noteswith descriptionscratch. - Read the sidecar
notes_description.md: it now holdsscratch, and the index showsscratchfor both files. - Rewrite
noteswithout a description: the sidecar is deleted, destroyingnotes.md's description.
Minimal Reproduction
import asyncio
from agent_framework import AgentSession, FileMemoryProvider, InMemoryAgentFileStore
class _Ctx: # minimal context capturing the registered tools
def __init__(self): self.session_id = "session-1"; self.tools = []
def extend_instructions(self, *a, **k): pass
def extend_tools(self, source_id, tools): self.tools.extend(tools)
def extend_messages(self, *a, **k): pass
async def main() -> None:
store = InMemoryAgentFileStore()
provider = FileMemoryProvider(store=store, scope="user-1")
ctx = _Ctx()
await provider.before_run(agent=None, session=AgentSession(session_id="session-1"), context=ctx, state={})
write = {t.name: t for t in ctx.tools if hasattr(t, "name")}["file_memory_write"]
await write.invoke(arguments={"file_name": "notes.md", "content": "architecture notes", "description": "architecture"})
await write.invoke(arguments={"file_name": "notes", "content": "scratch", "description": "scratch"})
assert await store.read("user-1/notes_description.md") == "scratch" # one shared sidecar
await write.invoke(arguments={"file_name": "notes", "content": "more scratch"})
assert await store.read("user-1/notes_description.md") is None # notes.md description destroyed
asyncio.run(main())
Error Messages and Stack Traces
No exception; the failure is silent description loss.
Package Versions
agent-framework-core: 1.23.0 (main @ 4d28d0a4b)
Python Version
Python 3.14.8
Operating System
macOS
Regression
Unknown
Additional Context
Appending the suffix to the full name keeps the mapping injective while extension-less names keep their existing sidecar name, and sidecars written under the previous naming can still be read through a fallback so existing descriptions survive an upgrade. I have that fix ready once the team agrees with the direction.
Acknowledgements
- [x] I searched existing issues and did not find a duplicate.
- [x] I personally verified this behavior and the reproduction details are authentic.
- [x] I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.
please use the defined issue templates and wait for the team to review before opening a PR @ManoharPaturi
Working on a fix for this. Approach: sidecars named after the whole memory file name (notes.md → notes.md._description.md), which is injective and disjoint from every legacy <stem>_description.md name by construction (a stem never ends in .), so no migration machinery is needed. Long names (>255-byte sidecar) and reserved ~memory-desc- names (matched after NFKC + casefold) fall back to a SHA-256 digest sidecar derived from the backend's canonical stored name. PR incoming as a draft for review.