Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
fix(weixin): silence polling request logs
Lanre Shittudb6ef4d67463
diff --git a/nanobot/channels/weixin/runtime.py b/nanobot/channels/weixin/runtime.pyindex ff1449c4b..9a5772254 100644--- a/nanobot/channels/weixin/runtime.py+++ b/nanobot/channels/weixin/runtime.py@@ -37,6 +37,7 @@ from nanobot.bus.queue import MessageBusfrom nanobot.channels.base import BaseChannelfrom nanobot.config.paths import get_media_dir, get_runtime_subdirfrom nanobot.config.schema import Base+from nanobot.utils.logging_bridge import redirect_lib_logging# ---------------------------------------------------------------------------# Protocol constants (from openclaw-weixin types.ts)@@ -996,6 +997,7 @@ class WeixinChannel(BaseChannel):self._client = Noneasync def start(self) -> None:+ redirect_lib_logging("httpx", level="WARNING")self._running = Trueself._next_poll_timeout_s = self.config.poll_timeoutself._client = self._new_http_client(diff --git a/nanobot/channels/weixin/tests/test_weixin_hardening.py b/nanobot/channels/weixin/tests/test_weixin_hardening.pyindex 534c2b5b3..bce910e84 100644--- a/nanobot/channels/weixin/tests/test_weixin_hardening.py+++ b/nanobot/channels/weixin/tests/test_weixin_hardening.py@@ -3,7 +3,7 @@ from __future__ import annotationsimport asyncioimport jsonimport time-from unittest.mock import AsyncMock+from unittest.mock import AsyncMock, Mockimport httpximport pytest@@ -74,6 +74,22 @@ def test_reply_progress_opt_in_enables_progress_transport() -> None:assert config.send_tool_hints is True+async def test_start_suppresses_httpx_polling_logs(monkeypatch) -> None:+ channel = _channel(token="bot-token")+ redirect = Mock()+ monkeypatch.setattr("nanobot.channels.weixin.runtime.redirect_lib_logging", redirect)+ monkeypatch.setattr(channel, "_notify_lifecycle", AsyncMock())++ async def poll_once() -> None:+ channel._running = False++ monkeypatch.setattr(channel, "_poll_once", poll_once)+ await channel.start()++ redirect.assert_called_once_with("httpx", level="WARNING")++@pytest.mark.parametrize(("section", "send_progress", "send_tool_hints"),[