diff --git a/pipeline_service/agent_loop.py b/pipeline_service/agent_loop.py index 5cf26f0..625ca53 100644 --- a/pipeline_service/agent_loop.py +++ b/pipeline_service/agent_loop.py @@ -890,7 +890,7 @@ async def _exec_agent_tool(tool, params, workspace_dir): if not await _is_safe_workdir_async(full): return 'FAIL: 路径不在允许范围' if not os.path.isfile(full): return f'FAIL: 文件不存在 {path}' with open(full, encoding='utf-8') as f: - return f.read()[:30000] + return f.read()[:12000] elif tool == 'write_file': path = p.get('path', '') content = p.get('content', '') @@ -950,8 +950,9 @@ _FORCE_PRODUCE_TURN = 5 # LLM 调用硬超时(外层 asyncio.wait_for 兜底)。llm_bridge 内部 300s×3 重试最坏 15 分钟, # 期间 role_agent_run 心跳不更新(心跳在调用前 touch),观察上像任务挂起/僵尸。 -# 外层硬上限:① 缩短最坏时长到 7 分钟 ② 防 aiohttp total 超时因 DNS 等场景失效导致的真正无限挂起。 -_LLM_HARD_TIMEOUT = 420 +# 外层硬上限:① 防 aiohttp total 超时因 DNS 等场景失效导致的真正无限挂起 ② 给 llm_bridge 至少 2 轮完整重试机会 +# (420s 只够 ~1.4 轮,网关瞬时挂起时重试被提前掐断,可自愈的瞬时故障也 TimeoutError 超限暂停任务链)。 +_LLM_HARD_TIMEOUT = 600 _FORCE_PRODUCE_HINT = ( "⚠️ 你已经探索了足够多轮(已超过 5 轮)。现在必须立即产出并交付:\n"