From f732c40b84faf0e65c1d8582e91864d6ef1920cf Mon Sep 17 00:00:00 2001 From: butubb <1422726308@qq.com> Date: Fri, 4 Sep 2026 12:59:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Agent=20=E8=BF=90=E8=A1=8C=E6=95=B4?= =?UTF-8?q?=E4=BD=93=20600s=20=E8=B6=85=E6=97=B6=E5=85=9C=E5=BA=95?= =?UTF-8?q?=EF=BC=88=E6=A8=A1=E5=9E=8B/=E5=B7=A5=E5=85=B7=E5=8D=A1?= =?UTF-8?q?=E6=AD=BB=E6=97=B6=E9=87=8A=E6=94=BE=E5=8D=95=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/agent_api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/agent_api.py b/web/agent_api.py index 111d333..9db6859 100644 --- a/web/agent_api.py +++ b/web/agent_api.py @@ -146,7 +146,8 @@ def _agent_thread(run_id, prompt, cfg): await agent._load_tools() return await agent.run(prompt, cfg.get("default_serial") or "") - answer = asyncio.run(_run()) + # 整体超时保护:模型/工具卡死时结束运行,避免单实例被永久占用 + answer = asyncio.run(asyncio.wait_for(_run(), timeout=600)) with _lock: _run["state"] = "done" _run["answer"] = answer