From 19c7d05105c2a6dc58595d8815d040d1310f6fbd Mon Sep 17 00:00:00 2001 From: ymq Date: Wed, 2 Sep 2026 17:56:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20load=5Fskill=E6=94=AF=E6=8C=81file=5Fpat?= =?UTF-8?q?h=E5=AD=90=E6=96=87=E4=BB=B6=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v2引擎_t_load_skill只返回主文档,参考文件无法读取(内部agent实测反馈) - file_path走Skill.read_linked_file(已带路径穿越防护) - 主文档加载时列出可用子文件 - 子文件加载失败时提示可用子文件清单 --- pipeline_service/agent_loop_v2.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pipeline_service/agent_loop_v2.py b/pipeline_service/agent_loop_v2.py index c1639bc..6729874 100644 --- a/pipeline_service/agent_loop_v2.py +++ b/pipeline_service/agent_loop_v2.py @@ -1181,7 +1181,18 @@ class AgentExecutor: names = format_skill_names(merged) return (f"FAIL: 技能 '{name}' 不存在。注意:name 只传技能裸名" f"(如 bid-workflow),不要带 [产线] 前缀或描述文字。可用技能: {names}") - return skill.to_prompt_block() + file_path = (p.get("file_path") or "").strip() + if file_path: + body = skill.read_linked_file(file_path) + if body.startswith("FAIL") or body.startswith("ERROR"): + linked = skill.list_linked_files() + return f"{body}\n可用子文件: {', '.join(linked) if linked else '(无)'}" + return f"## [{skill.name}] {file_path}\n\n{body}" + block = skill.to_prompt_block() + linked = skill.list_linked_files() + if linked: + block += f"\n(可用子文件,用 file_path 参数加载:{', '.join(linked)})\n" + return block async def _t_list_packs(self, sor, p, pid): try: