From 32ac92b8f0f2473f5a9ecdcd7ba5f688c79551c7 Mon Sep 17 00:00:00 2001 From: OoO Date: Tue, 28 Apr 2026 12:15:42 +0800 Subject: [PATCH] fix: _ssh_exec signature in ElephantAlpha --- services/elephant_alpha_autonomous_engine.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/elephant_alpha_autonomous_engine.py b/services/elephant_alpha_autonomous_engine.py index 0e81e6e..4749528 100644 --- a/services/elephant_alpha_autonomous_engine.py +++ b/services/elephant_alpha_autonomous_engine.py @@ -664,18 +664,20 @@ class ElephantAlphaAutonomousEngine: self._log.error("Telegram escalation failed (non-blocking): %s", e) # ---- Resource Optimization ---- - def _ssh_exec(self, cmd: str, timeout: int = 60) -> tuple: - """Execute command via SSH jump host.""" + def _ssh_exec(self, host: str, user: str, cmd: str, timeout: int = 120) -> tuple: + """Execute command via SSH jump host to target host.""" import subprocess import shlex + # 這裡實作 SSH 跳板或直接連線邏輯,根據 ADR-013 應透過跳板機 + # 簡化版:直接從容器透過 SSH 連向目標 (188) full_cmd = [ "ssh", "-p", str(SSH_PORT), "-i", SSH_KEY_PATH, "-o", "StrictHostKeyChecking=no", "-o", "ConnectTimeout=10", - f"{SSH_JUMP_USER}@{SSH_JUMP_HOST}", + f"{user}@{host}", cmd ] try: