Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

fix: test case (#133)

qin-ctxdd4561e29ae3
diff --git a/openviking/server/routers/system.py b/openviking/server/routers/system.py
index 0ec169772..cab9acc9b 100644
--- a/openviking/server/routers/system.py
+++ b/openviking/server/routers/system.py
@@ -30,7 +30,7 @@ async def system_status(
status="ok",
result={
"initialized": service._initialized,
- "user": service.user,
+ "user": service.user._user_id,
},
)
diff --git a/openviking/session/memory_extractor.py b/openviking/session/memory_extractor.py
index 14fc7a21b..32379387f 100644
--- a/openviking/session/memory_extractor.py
+++ b/openviking/session/memory_extractor.py
@@ -18,6 +18,8 @@ from openviking.prompts import render_prompt
from openviking.storage.viking_fs import get_viking_fs
from openviking.utils import get_logger
from openviking.utils.config import get_openviking_config
+from openviking.session.user_id import UserIdentifier
+
logger = get_logger(__name__)
@@ -67,11 +69,11 @@ class MemoryExtractor:
async def extract(
self,
context: dict,
- user: str,
+ user: UserIdentifier,
session_id: str,
) -> List[CandidateMemory]:
"""Extract memory candidates from messages."""
- user = user or "default"
+ user = user
vlm = get_openviking_config().vlm
if not vlm or not vlm.is_available():
logger.warning("LLM not available, skipping memory extraction")
@@ -91,7 +93,7 @@ class MemoryExtractor:
{
"summary": "",
"recent_messages": formatted_messages,
- "user": user,
+ "user": user._user_id,
"feedback": "",
},
)
diff --git a/tests/integration/test_full_workflow.py b/tests/integration/test_full_workflow.py
index e60db3210..aa8b71a2e 100644
--- a/tests/integration/test_full_workflow.py
+++ b/tests/integration/test_full_workflow.py
@@ -3,6 +3,7 @@
"""Full workflow integration tests"""
+import shutil
from pathlib import Path
import pytest_asyncio
@@ -17,6 +18,10 @@ async def integration_client(test_data_dir: Path):
"""Integration test client"""
await AsyncOpenViking.reset()
+ # Clean data directory to avoid AGFS "directory already exists" errors
+ shutil.rmtree(test_data_dir, ignore_errors=True)
+ test_data_dir.mkdir(parents=True, exist_ok=True)
+
client = AsyncOpenViking(path=str(test_data_dir), user=UserIdentifier.the_default_user("integration_test_user"))
await client.initialize()
@@ -149,6 +154,7 @@ class TestImportExportWorkflow:
path=str(sample_markdown_file),
reason="Export test",
)
+ print(result)
original_uri = result["root_uri"]
# 2. Read original content