fix: git clone 操作 timeout 设为 120s

This commit is contained in:
yumoqing 2026-08-06 14:19:44 +08:00
parent 46239bccc7
commit 9c84c3dcbc

View File

@ -895,7 +895,7 @@ if action == 'send_message':
# 特殊处理:包含"到本地""到工作区"→只保留 git clone url
cmd = re.sub(r'(\s+(到本地|到工作区|到workspace).*)', '', cmd).strip()
workdir = ctx.get('workspace_dir', '') or '/d/pipeline/workspaces'
result = await shell_exec(cmd, workdir=workdir)
result = await shell_exec(cmd, workdir=workdir, timeout=120 if 'git clone' in cmd else 60)
if result['rc'] == 0:
out = result['stdout'].strip()
agent_reply = f"执行成功。{'输出:' + out[:500] if out else '(无输出)'}"