Improve WebCRT new-session flow for SecureCRT-like SSH/Telnet use.

Add quick-connect sessions with credential retry, raw interactive drivers, bootstrap banner replay, Huawei telnet prompt cleanup, and session rename/delete in the tree.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-01 22:52:31 +08:00
parent accd28c9a1
commit f6b399e03e
23 changed files with 3682 additions and 225 deletions

View file

@ -54,6 +54,18 @@ def format_cli_failure(exc: BaseException | str, transcript: str = "", *, limit:
"""Human/ops-facing failure message; promote auth rejects above Pattern/ReadTimeout."""
if isinstance(exc, BaseException):
exc_text = f"{type(exc).__name__}: {exc}"
# Paramiko/Netmiko auth exceptions may carry little/no message text.
try:
import paramiko
if isinstance(exc, paramiko.AuthenticationException):
detail = str(exc).strip() or type(exc).__name__
return f"auth_rejected: {detail}"[:limit]
except Exception:
pass
if "AuthenticationException" in type(exc).__name__:
detail = str(exc).strip() or type(exc).__name__
return f"auth_rejected: {detail}"[:limit]
else:
exc_text = str(exc or "")
combined = f"{exc_text}\n{transcript or ''}"