Skip to content

.NET: Python: MemoryFileStore topic slug collisions silently overwrite another topic's memories #9723

Open

Description

Description

MemoryFileStore keys every topic file by _slugify_topic(topic), which strips everything that is not a to z or 0 to 9. The mapping is many to one: C ++ and C # both slug to c, node.js and node js both slug to node-js, and API and api collide too. write_topic then does an unconditional overwrite of the slug path, so writing a second topic that shares a slug with an existing one silently destroys the first topic's memories.

Reproduced on current main: write topic C ++ with the memory Modern C ++ prefers smart pointers, then topic C # with C # 12 primary constructors. Afterwards get_topic("C ++") returns the C # memory, the C ++ memory is gone, and list_topics shows a single topic.

The same file family deliberately uses the injective _storage_key_segment derivation for owner ids, session ids, source ids, and scopes, precisely so two byte distinct values do not share a storage location. The topic filename is the one mapping left below that standard.

Expected Behavior

Distinct topics must never share a memory file. Writing C ++ and C # should persist two files whose contents survive, and get_topic by topic name should keep returning each topic's own memories.

Steps to Reproduce

  1. Create a MemoryFileStore and write two topics whose names share a slug.
  2. Read the first topic back.

Minimal Reproduction

store.write_topic(session, MemoryTopicRecord(topic="C++", summary="cpp", memories=["smart pointers"], updated_at=...), source_id="memory")
store.write_topic(session, MemoryTopicRecord(topic="C#", summary="csharp", memories=["primary constructors"], updated_at=...), source_id="memory")
store.get_topic(session, source_id="memory", topic="C++").memories  # returns the C# memory on main

Package Versions

agent_framework core from main.

Python Version

3.11

Activity

  1. added
    .NETUsage: [Issues, PRs], Target: .Net
    pythonUsage: [Issues, PRs], Target: Python
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Oct 26, 2026
  2. changed the title [-]Python: MemoryFileStore topic slug collisions silently overwrite another topic's memories[/-] [+].NET: Python: MemoryFileStore topic slug collisions silently overwrite another topic's memories[/+] on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETUsage: [Issues, PRs], Target: .NetpythonUsage: [Issues, PRs], Target: PythontriageUsage: [Issues], Target: All issues that still need to be triaged

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions