Skip to content

Your lightweight open-source personal agent.

fix(tui): avoid blocking local gateway startup

chengyongruc5ae958bc30d
diff --git a/nanobot/cli/webui_support.py b/nanobot/cli/webui_support.py
index 961a229cb..b27d53af5 100644
--- a/nanobot/cli/webui_support.py
+++ b/nanobot/cli/webui_support.py
@@ -192,10 +192,9 @@ def _prepare_webui_bundle_for_gateway(
return typer.confirm(message, default=True)
try:
- # A source checkout is the development product. Every gateway entrypoint
- # keeps its browser client in lockstep with Python; only Vite mode skips
- # the production bundle intentionally.
- if mode != "skip" and inspect_webui_bundle().source_available:
+ # Interactive WebUI commands keep source and bundle in lockstep.
+ # Warn-only gateway startup must not block on a frontend build.
+ if mode not in {"skip", "warn"} and inspect_webui_bundle().source_available:
mode = "auto"
ensure_webui_bundle(
mode=mode,
diff --git a/tests/cli/test_webui_support.py b/tests/cli/test_webui_support.py
index 94116f5b6..5a98148b4 100644
--- a/tests/cli/test_webui_support.py
+++ b/tests/cli/test_webui_support.py
@@ -4,7 +4,7 @@ from nanobot.cli.webui_support import _prepare_webui_bundle_for_gateway
from nanobot.config.schema import Config
-def test_source_checkout_rebuilds_the_webui_from_every_gateway_entrypoint(monkeypatch) -> None:
+def test_source_checkout_preserves_warn_only_gateway_startup(monkeypatch) -> None:
modes: list[str] = []
monkeypatch.setattr(
"nanobot.cli.webui_support.inspect_webui_bundle",
@@ -18,7 +18,7 @@ def test_source_checkout_rebuilds_the_webui_from_every_gateway_entrypoint(monkey
_prepare_webui_bundle_for_gateway(Config(), mode="warn")
- assert modes == ["auto"]
+ assert modes == ["warn"]
def test_vite_mode_does_not_build_the_source_webui_bundle(monkeypatch) -> None: