feat: 扩充 shell 命令白名单(含 containerd/ctr/nerdctl),解除 AI Agent 轮数上限

- 新增 ~50 个 Linux 基础命令(du/top/iostat/sar/curl/tcpdump 等)
- 新增 containerd 系列: ctr (containers/images/tasks/snapshots),
  nerdctl (ps/logs/inspect/stats 等)
- ip 命令补充 maddr/monitor/tunnel/tuntap 只读操作
- _run_agent_loop 改为 while True 循环,max_steps=0 表示不限轮数
- main.py 传入 max_steps=0,AI Agent 持续诊断直到问题解决
- 更新 Agent system prompt 第7条:明确无轮数上限
This commit is contained in:
Your Name
2026-07-25 14:17:56 +08:00
parent 1f37cd3268
commit 4b54e49a0d
3 changed files with 30 additions and 12 deletions
+1
View File
@@ -327,6 +327,7 @@ async def agent_diagnose_stream(question: str = "", execution_mode: str = "ai"):
async for event in run_diagnostic_agent(
_last_report,
question=question,
max_steps=0,
execution_mode=execution_mode,
):
history_store.append_event(run_id, event.get("type", "event"), {k: v for k, v in event.items() if k != "type"})