Skip to content

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

fix(fs): fix mkdir (#1622)

Jiahui Zhouce2cb09dc84b
diff --git a/openviking/storage/viking_fs.py b/openviking/storage/viking_fs.py
index 8429f43c5..a0f5f966d 100644
--- a/openviking/storage/viking_fs.py
+++ b/openviking/storage/viking_fs.py
@@ -391,15 +391,13 @@ class VikingFS:
path = self._uri_to_path(uri, ctx=ctx)
# Always ensure parent directories exist before creating this directory
await self._ensure_parent_dirs(path)
-
- if exist_ok:
- try:
- await self.stat(uri, ctx=ctx)
- return None
- except Exception:
- pass
-
- self.agfs.mkdir(path)
+ try:
+ self.agfs.mkdir(path)
+ except Exception as exc:
+ message = str(exc).lower()
+ already_exists = "exist" in message or "already" in message
+ if exist_ok and already_exists:
+ return
async def rm(
self,