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
test(remote): isolate gateway smoke from frontend build artifacts
Xubin Renc734f6b6f9d5
diff --git a/tests/webui/test_gateway_webui_smoke.py b/tests/webui/test_gateway_webui_smoke.pyindex 008e96c92..481047593 100644--- a/tests/webui/test_gateway_webui_smoke.py+++ b/tests/webui/test_gateway_webui_smoke.py@@ -19,14 +19,24 @@ import websocketsfrom nanobot.config.loader import load_configfrom nanobot.session.manager import SessionManagerfrom nanobot.session.recovery import PENDING_USER_TURN_KEY, RUNTIME_CHECKPOINT_KEY+from nanobot.webui.local_client_assets import LocalClientAssetsfrom nanobot.webui.remote_proxy import RemoteProxyfrom nanobot.webui.remote_ssh import Tunnel_BOOTSTRAP_SECRET = "smoke-secret"-async def test_remote_proxy_with_real_gateway_chat_settings_and_renewal(tmp_path: Path) -> None:+async def test_remote_proxy_with_real_gateway_chat_settings_and_renewal(+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch,+) -> None:"""The auth proxy must preserve the actual gateway's WebUI mutation audience."""+ # Python CI runs from a clean source tree without a frontend build. Supply+ # this transport smoke's own local shell instead of relying on build leftovers.+ assets = tmp_path / "local-dist"+ assets.mkdir()+ shell = "<!doctype html><title>Local smoke client</title>"+ (assets / "index.html").write_text(shell, encoding="utf-8")+ monkeypatch.setattr("nanobot.webui.remote_proxy.LocalClientAssets", lambda: LocalClientAssets(assets))ws_port, gateway_port = _free_port(), _free_port()workspace = tmp_path / "workspace"workspace.mkdir()@@ -42,6 +52,7 @@ async def test_remote_proxy_with_real_gateway_chat_settings_and_renewal(tmp_pathpause=AsyncMock(), close=AsyncMock())proxy = await RemoteProxy.open(transport, _BOOTSTRAP_SECRET, upstream["terminal"]["gatewayId"])async with httpx.AsyncClient(trust_env=False) as client:+ assert (await client.get(proxy.origin + "/")).text == shellfirst = (await client.get(proxy.origin + "/webui/bootstrap", headers={"X-Nanobot-Auth": proxy.secret,})).json()