diff --git a/openviking/storage/queuefs/semantic_dag.py b/openviking/storage/queuefs/semantic_dag.py index 55cacc691..db8137b8d 100644 --- a/openviking/storage/queuefs/semantic_dag.py +++ b/openviking/storage/queuefs/semantic_dag.py @@ -6,6 +6,7 @@ from dataclasses import dataclass, field from typing import Awaitable, Callable, Dict, List, Optional +from openviking.core.directories import get_context_type_for_uri from openviking.server.identity import RequestContext from openviking.storage.viking_fs import get_viking_fs from openviking_cli.utils import VikingURI @@ -440,7 +441,7 @@ async def _file_summary_task(self, parent_uri: str, file_path: str) -> None: task = VectorizeTask( task_type="file", uri=file_path, - context_type=self._context_type, + context_type=get_context_type_for_uri(file_path), ctx=self._ctx, semantic_msg_id=self._semantic_msg_id, file_path=file_path, @@ -560,7 +561,7 @@ async def _overview_task(self, dir_uri: str) -> None: task = VectorizeTask( task_type="directory", uri=dir_uri, - context_type=self._context_type, + context_type=get_context_type_for_uri(dir_uri), ctx=self._ctx, semantic_msg_id=self._semantic_msg_id, abstract=abstract, diff --git a/openviking/utils/summarizer.py b/openviking/utils/summarizer.py index dff099e62..a9c136880 100644 --- a/openviking/utils/summarizer.py +++ b/openviking/utils/summarizer.py @@ -7,6 +7,7 @@ from typing import TYPE_CHECKING, Any, Dict, List +from openviking.core.directories import get_context_type_for_uri from openviking.storage.queuefs import SemanticMsg, get_queue_manager from openviking.telemetry import get_current_telemetry from openviking_cli.utils import get_logger @@ -57,11 +58,7 @@ async def summarize( telemetry = get_current_telemetry() for uri, temp_uri in zip(resource_uris, temp_uris): # Determine context_type based on URI - context_type = "resource" - if uri.startswith("viking://memory/"): - context_type = "memory" - elif uri.startswith("viking://agent/skills/"): - context_type = "skill" + context_type = get_context_type_for_uri(uri) msg = SemanticMsg( uri=temp_uri,