Files
Nexus/docs/changelog/2026-06-07-script-exec-ssh-not-agent-online.md
T
Nexus Agent c8b0663508
Nexus CI/CD / test (push) Waiting to run
Nexus CI/CD / deploy (push) Blocked by required conditions
Nexus Pre-commit Checks / quick-check (push) Waiting to run
feat: 批量IP添加、脚本库历史、推送权限记录与脚本SSH执行修复
批量添加替代CSV并支持去重;脚本库页内嵌执行历史;推送历史记录 rsync 权限策略;
脚本执行不再依赖 Agent 在线;服务器同步日志与相关单测补齐。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 03:15:40 +08:00

966 B
Raw Blame History

脚本执行:移除 Agent 在线门禁,改判 SSH 凭据

日期: 2026-06-07

变更摘要

ScriptService._dispatch_to_servers 不再要求 is_online(Agent 心跳),改为检查服务器是否存在且已配置 SSH 凭据后直连 SSH 执行。

动机

用户执行脚本 #3 于 2 台服务器瞬间 failed (2 台失败)。根因:经「批量 IP / 凭据轮询」入库的机器通常 无 Agentis_online=false,旧逻辑直接跳过并记 exit_code=-1,与「脚本走 SSH」设计矛盾。

涉及文件

  • server/application/services/script_service.py_server_ssh_configured、dispatch / 拉日志
  • tests/test_script_dispatch.py — 回归单测

迁移 / 重启

  • 需重启 API worker

验证方式

pytest tests/test_script_dispatch.py -q

对无 Agent、有 SSH 凭据的服务器执行短脚本,应不再秒失败;执行详情 stderr 不再出现 Server offline or not found