"Vibe-Trading: Your Personal Trading Agent"
Python ai-agentalgorithmic-tradingbacktestingfintechllmmcpmulti-agentpythonquantitative-financetrading
fix(memory): write hierarchy-routed entries with the .md extension (#984)
Yufeng He7231011ac318
diff --git a/agent/src/memory/persistent.py b/agent/src/memory/persistent.pyindex c11290ecb..19d06f5a7 100644--- a/agent/src/memory/persistent.py+++ b/agent/src/memory/persistent.py@@ -490,7 +490,7 @@ class PersistentMemory:if get_env_config().memory.hierarchy_enabled:from src.memory.hierarchy import MemoryHierarchyhierarchy = MemoryHierarchy(self._dir)- path = hierarchy.route_entry(memory_type, slug)+ path = hierarchy.route_entry(memory_type, f"{slug}.md")else:filename = f"{memory_type}_{slug}.md"path = self._dir / filenamediff --git a/agent/tests/memory/test_tier2_integration.py b/agent/tests/memory/test_tier2_integration.pyindex 4c7c683a8..c4240cf3d 100644--- a/agent/tests/memory/test_tier2_integration.py+++ b/agent/tests/memory/test_tier2_integration.py@@ -70,6 +70,18 @@ class TestHierarchyAddRoutesToSubdir:assert path.parent == tmp_path / "user"assert path.exists()+ def test_hierarchy_add_writes_discoverable_md(self, tmp_path, monkeypatch):+ """With VT_MEMORY_HIERARCHY=true, add() must write a .md that list_entries sees."""+ monkeypatch.setenv("VT_MEMORY_HIERARCHY", "true")+ reset_env_config()++ mem = PersistentMemory(tmp_path)+ path = mem.add("visible entry", "content that must be discoverable", "project")++ assert path is not None+ assert path.suffix == ".md"+ assert "visible entry" in {e.title for e in mem.list_entries()}+# ---------------------------------------------------------------------------# 2. Hierarchy: scan_all finds both flat and routed entries