Skip to content

Commit bc35250

Browse files
swissmoclaude
andcommitted
debug: add entry-point diagnostics to _install_log_filters_if_available
The server-package-side diagnostics (log_filters.py, commit 7423224) confirmed install_sdk_log_filters() itself never logs anything -- but that leaves open whether _install_log_filters_if_available() is even being entered, or is silently returning via its "older ha-mcp" ModuleNotFoundError branch despite a full custom_components/ha_mcp_tools/ directory replacement (ruling out the single-file cross-module ModuleNotFoundError seen earlier). Add an unconditional entry log using embedded_server's own _LOGGER (already proven visible throughout this deployment across many other log lines), and stop silencing the "older ha-mcp" ModuleNotFoundError branch so its exact err.name/message is visible too, rather than assuming which case it hit. Marked TEMPORARY; remove alongside the other temporary diagnostics once the live mismatch is diagnosed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 7423224 commit bc35250

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

custom_components/ha_mcp_tools/embedded_server.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,23 +261,30 @@ def _install_log_filters_if_available() -> None:
261261
nothing: log cosmetics must never block startup, but they also must
262262
never fail invisibly.
263263
"""
264+
# TEMPORARY DIAGNOSTIC (2026-08-25, remove once the live install/
265+
# classification mismatch reported against this branch is found): proves
266+
# this function is actually entered, using embedded_server's OWN logger
267+
# (already proven visible throughout this deployment) rather than the
268+
# new module's, in case that one is somehow not surfacing.
269+
_LOGGER.warning("_install_log_filters_if_available: entered")
264270
try:
265271
from ha_mcp.log_filters import install_sdk_log_filters
266272
except ModuleNotFoundError as err:
267-
if err.name != "ha_mcp.log_filters":
268-
_LOGGER.warning(
269-
"Could not install MCP SDK log-noise filters (missing "
270-
"dependency %s); continuing without them: %s",
271-
err.name,
272-
err,
273-
)
273+
# TEMPORARY: always log now, including the previously-silent
274+
# "older ha-mcp" case, to see exactly what's missing.
275+
_LOGGER.warning(
276+
"_install_log_filters_if_available: ModuleNotFoundError name=%r msg=%s",
277+
err.name,
278+
err,
279+
)
274280
return
275281
except ImportError as err:
276282
_LOGGER.warning(
277283
"Could not install MCP SDK log-noise filters; continuing without them: %s",
278284
err,
279285
)
280286
return
287+
_LOGGER.warning("_install_log_filters_if_available: import succeeded, installing")
281288
try:
282289
install_sdk_log_filters()
283290
except Exception as err:

0 commit comments

Comments
 (0)