fix: load_skill支持file_path子文件加载
v2引擎_t_load_skill只返回主文档,参考文件无法读取(内部agent实测反馈) - file_path走Skill.read_linked_file(已带路径穿越防护) - 主文档加载时列出可用子文件 - 子文件加载失败时提示可用子文件清单
This commit is contained in:
parent
20471a1fda
commit
19c7d05105
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user