We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef72184 commit 3c1d5d1Copy full SHA for 3c1d5d1
app/api/routes_chat.py
@@ -860,10 +860,14 @@ async def _run_openclaw_cmd():
860
combined = "".join(collected_text_chunks)
861
matches = file_regex.findall(combined)
862
if matches:
863
+ # 校验路径是否存在,只保留存在的
864
+ valid_matches = [m for m in matches if os.path.isfile(m)]
865
+ log_warning(f"{matches}")
866
+ log_warning(f"{valid_matches}")
867
deploy_check_info = json.dumps({
868
"type": "result",
869
"is_error": False,
- "result": "\n".join(f"-`{m}`"for m in matches),
870
+ "result": "\n".join(f"-`{m}`" for m in valid_matches) if valid_matches else "",
871
}, ensure_ascii=False)
872
chunk = gpt_stream_chunk(deploy_check_info)
873
yield f"data: {json.dumps(chunk, ensure_ascii=False)}\n\n".encode("utf-8")
0 commit comments