From 4f5d0fa6b654b64c380a9ee06b9144d7cd26870b Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 2 Aug 2026 17:57:33 +0200 Subject: [PATCH] fix(claude_desktop): fail open on Headroom API changes --- .../etc/cont-init.d/81-headroom_wrapper.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/claude_desktop/rootfs/etc/cont-init.d/81-headroom_wrapper.sh b/claude_desktop/rootfs/etc/cont-init.d/81-headroom_wrapper.sh index ef12900220..ff438554f6 100644 --- a/claude_desktop/rootfs/etc/cont-init.d/81-headroom_wrapper.sh +++ b/claude_desktop/rootfs/etc/cont-init.d/81-headroom_wrapper.sh @@ -19,6 +19,22 @@ if [ -z "$REAL_HEADROOM" ]; then exit 0 fi +# The adapter intentionally uses a small, stable subset of the upstream MCP +# server. Since Headroom is installed unpinned at image build time, verify that +# subset before replacing the command. A future incompatible Headroom release +# therefore keeps its native MCP server instead of breaking Claude startup. +if ! /lsiopy/bin/python3 - <<'PY' +from headroom.ccr.mcp_server import HeadroomMCPServer + +for name in ("run_stdio", "cleanup", "_compress_content"): + if not callable(getattr(HeadroomMCPServer, name, None)): + raise SystemExit(f"HeadroomMCPServer.{name} is unavailable") +PY +then + bashio::log.warning "Installed Headroom is incompatible with the single-runtime MCP adapter; preserving the native MCP server" + exit 0 +fi + wrapper="$(mktemp /usr/local/bin/.headroom-wrapper.XXXXXX)" cleanup() { rm -f "$wrapper"