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..6f3c2dcd4 100644 --- a/openviking/utils/summarizer.py +++ b/openviking/utils/summarizer.py @@ -57,10 +57,11 @@ async def summarize( telemetry = get_current_telemetry() for uri, temp_uri in zip(resource_uris, temp_uris): # Determine context_type based on URI + # Use the same logic as core/directories.get_context_type_for_uri() context_type = "resource" - if uri.startswith("viking://memory/"): + if "/memories" in uri: context_type = "memory" - elif uri.startswith("viking://agent/skills/"): + elif "/skills" in uri: context_type = "skill" msg = SemanticMsg(