From 66e5d63d898e276dc86712a5476eabc329d294e7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Apr 2026 20:22:59 +0000 Subject: [PATCH 1/3] Initial plan From 93b5cc5b465c71667b23a422b3afb57cebd55d9c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Apr 2026 20:31:41 +0000 Subject: [PATCH 2/3] fix: pre-import fido2.client.windows to avoid AttributeError on Python 3.14 Agent-Logs-Url: https://github.com/gensyn/ssh_command/sessions/40be7829-f1be-4b60-83c3-b24fe786b4a8 Co-authored-by: gensyn <36128035+gensyn@users.noreply.github.com> --- coordinator.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/coordinator.py b/coordinator.py index 1aac8ee..b1a7bae 100644 --- a/coordinator.py +++ b/coordinator.py @@ -12,9 +12,22 @@ import logging import socket +import sys from pathlib import Path from typing import Any +# asyncssh optionally imports fido2.client.windows for Windows WebAuthn support. +# fido2's Windows-specific module (win_api) uses ctypes.HRESULT, which Python 3.14 +# removed on non-Windows platforms, causing an AttributeError that asyncssh does not +# catch (it only catches ImportError in that code path). Pre-attempt the import here +# so that on failure we can replace the broken sys.modules entry with None, which +# makes Python raise ImportError instead — and asyncssh handles that gracefully. +if sys.platform != "win32": + try: + import fido2.client.windows # noqa: F401 + except (ImportError, OSError, AttributeError): + sys.modules["fido2.client.windows"] = None # type: ignore[assignment] + from asyncssh import HostKeyNotVerifiable, KeyImportError, PermissionDenied, connect, read_known_hosts from homeassistant.const import CONF_USERNAME, CONF_PASSWORD, CONF_HOST, CONF_COMMAND, CONF_TIMEOUT From cffc39f069fab1afc157b4f115c64fe733ad9205 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Apr 2026 20:32:57 +0000 Subject: [PATCH 3/3] fix: add debug logging when fido2.client.windows is unavailable Agent-Logs-Url: https://github.com/gensyn/ssh_command/sessions/40be7829-f1be-4b60-83c3-b24fe786b4a8 Co-authored-by: gensyn <36128035+gensyn@users.noreply.github.com> --- coordinator.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/coordinator.py b/coordinator.py index b1a7bae..88086d0 100644 --- a/coordinator.py +++ b/coordinator.py @@ -16,6 +16,8 @@ from pathlib import Path from typing import Any +_LOGGER = logging.getLogger(__name__) + # asyncssh optionally imports fido2.client.windows for Windows WebAuthn support. # fido2's Windows-specific module (win_api) uses ctypes.HRESULT, which Python 3.14 # removed on non-Windows platforms, causing an AttributeError that asyncssh does not @@ -25,7 +27,11 @@ if sys.platform != "win32": try: import fido2.client.windows # noqa: F401 - except (ImportError, OSError, AttributeError): + except (ImportError, OSError, AttributeError) as _fido2_err: + _LOGGER.debug( + "fido2.client.windows unavailable (%s); asyncssh Windows WebAuthn support disabled", + _fido2_err, + ) sys.modules["fido2.client.windows"] = None # type: ignore[assignment] from asyncssh import HostKeyNotVerifiable, KeyImportError, PermissionDenied, connect, read_known_hosts @@ -48,8 +54,6 @@ CONST_DEFAULT_TIMEOUT, ) -_LOGGER = logging.getLogger(__name__) - class SshCommandCoordinator: """Single owner of all SSH I/O for the SSH Command integration.