This commit is contained in:
yumoqing 2026-02-13 17:02:48 +08:00
parent bec9ec3a14
commit 56602d54a0

View File

@ -65,11 +65,11 @@ async def run_subprocess(command, cwd, env, timeout=30.0):
raise Exception(f"{command} 执行超时") raise Exception(f"{command} 执行超时")
# 对应 text=True手动解码 # 对应 text=True手动解码
return { return DictObject(**{
"stdout": stdout.decode().strip(), "stdout": stdout.decode().strip(),
"stderr": stderr.decode().strip(), "stderr": stderr.decode().strip(),
"return_code": process.returncode "return_code": process.returncode
} })
except Exception as e: except Exception as e:
print(f"{command} 执行异常: {e}") print(f"{command} 执行异常: {e}")
@ -239,7 +239,11 @@ class IndustrialSkillEngine:
# 决策:是直接回答还是执行脚本 # 决策:是直接回答还是执行脚本
decision = await self.llm(f"上下文: {context}\n问题: {user_prompt}\n决定动作EXEC: <command> 或 ANSWER: <text> 或 REPLY: <question>") decision = await self.llm(f"上下文: {context}\n问题: {user_prompt}\n决定动作EXEC: <command> 或 ANSWER: <text> 或 REPLY: <question>")
output = {
"status": "PROCESSING",
"hint": f"决策完成:{decision=}"
}
await self.write_output(output)
if "REPLY" in decision: if "REPLY" in decision:
sessionkey = getID() sessionkey = getID()
await self.write_output({ await self.write_output({