diff --git a/openviking/server/routers/system.py b/openviking/server/routers/system.py index 0ec16977..cab9acc9 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 14fc7a21..32379387 100644 --- a/openviking/session/memory_extractor.py +++ b/openviking/session/memory_extractor.py @@ -18,6 +18,8 @@ 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 @@ def __init__(self): 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 @@ async def extract( { "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 e60db321..aa8b71a2 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 @@ async def test_export_import_roundtrip( path=str(sample_markdown_file), reason="Export test", ) + print(result) original_uri = result["root_uri"] # 2. Read original content