Skip to content

Commit 1b75905

Browse files
typecktangyunpeng.314
andauthored
fix vikingbot grep/glob/add_resource get response issue (#491)
Co-authored-by: tangyunpeng.314 <tangyunpeng.314@bytedance.com>
1 parent f760740 commit 1b75905

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bot/vikingbot/agent/tools/ov_file.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ async def execute(
218218
)
219219

220220
if result:
221-
root_uri = result.get("result", {}).get("root_uri", "unknown")
221+
root_uri = result.get("root_uri", "unknown")
222222
return f"Successfully added resource: {root_uri}"
223223
else:
224224
return "Failed to add resource"
@@ -272,8 +272,8 @@ async def execute(
272272
result = await client.grep(uri, pattern, case_insensitive=case_insensitive)
273273

274274
if isinstance(result, dict):
275-
matches = result.get("result", {}).get("matches", [])
276-
count = result.get("result", {}).get("count", 0)
275+
matches = result.get("matches", [])
276+
count = result.get("count", 0)
277277
else:
278278
matches = getattr(result, "matches", [])
279279
count = getattr(result, "count", 0)
@@ -336,8 +336,8 @@ async def execute(
336336
result = await client.glob(pattern, uri=uri or None)
337337

338338
if isinstance(result, dict):
339-
matches = result.get("result", {}).get("matches", [])
340-
count = result.get("result", {}).get("count", 0)
339+
matches = result.get("matches", [])
340+
count = result.get("count", 0)
341341
else:
342342
matches = getattr(result, "matches", [])
343343
count = getattr(result, "count", 0)

0 commit comments

Comments
 (0)