From b02915e71ded8304f8fbffe408cc4d32e23798de Mon Sep 17 00:00:00 2001 From: qin-ctx Date: Wed, 24 Jun 2026 14:29:02 +0800 Subject: [PATCH] fix(storage): preserve glob result URI scheme Use tree entry URIs for glob matches so root-scope glob results keep the viking:// scheme and share the existing canonical URI handling. --- openviking/storage/viking_fs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openviking/storage/viking_fs.py b/openviking/storage/viking_fs.py index d67aff52fb..f371888f3c 100644 --- a/openviking/storage/viking_fs.py +++ b/openviking/storage/viking_fs.py @@ -993,12 +993,11 @@ async def glob( ) -> Dict: """File pattern matching, supports **/*.md recursive.""" entries = await self.tree(uri, node_limit=1000000, level_limit=None, ctx=ctx) - base_uri = uri.rstrip("/") matches = [] for entry in entries: rel_path = entry.get("rel_path", "") if PurePath(rel_path).match(pattern): - matches.append(f"{base_uri}/{rel_path}") + matches.append(entry["uri"]) # Now apply node limit to the filtered matches if node_limit is not None and node_limit > 0: matches = matches[:node_limit]