diff --git a/nanobot/cli/webui.py b/nanobot/cli/webui.py index 6fec3c60d..ed19915a4 100644 --- a/nanobot/cli/webui.py +++ b/nanobot/cli/webui.py @@ -216,11 +216,9 @@ def webui( f"{config_path}, or rerun without --no-open to open the authenticated URL.[/dim]" ) - webui_bundle_mode = _webui_build_mode_for_interactive(yes=yes) - _prepare_webui_bundle_for_gateway( - runtime_config, - mode="skip" if dev else webui_bundle_mode, - ) + if not dev: + webui_bundle_mode = _webui_build_mode_for_interactive(yes=yes) + _prepare_webui_bundle_for_gateway(runtime_config, mode=webui_bundle_mode) instance = GatewayInstance.resolve( config_path=config_path, diff --git a/tests/cli/test_commands.py b/tests/cli/test_commands.py index d628b9cca..d669bca78 100644 --- a/tests/cli/test_commands.py +++ b/tests/cli/test_commands.py @@ -2288,6 +2288,10 @@ def test_webui_dev_starts_vite_sidecar_and_gateway(monkeypatch, tmp_path: Path) monkeypatch.setattr("nanobot.cli.webui.run_webui_dev_server", fake_dev_server) _patch_webui_managed_gateway(monkeypatch, seen) + monkeypatch.setattr( + "nanobot.cli.webui._prepare_webui_bundle_for_gateway", + lambda *_args, **_kwargs: pytest.fail("dev mode must not inspect the bundled WebUI"), + ) monkeypatch.setattr( "nanobot.cli.webui._attach_to_background_gateway", lambda runtime, **kwargs: seen.update( diff --git a/tests/cli/test_webui_support.py b/tests/cli/test_webui_support.py index 5a98148b4..91a2241ae 100644 --- a/tests/cli/test_webui_support.py +++ b/tests/cli/test_webui_support.py @@ -21,7 +21,7 @@ def test_source_checkout_preserves_warn_only_gateway_startup(monkeypatch) -> Non assert modes == ["warn"] -def test_vite_mode_does_not_build_the_source_webui_bundle(monkeypatch) -> None: +def test_skip_mode_does_not_build_the_source_webui_bundle(monkeypatch) -> None: modes: list[str] = [] monkeypatch.setattr( "nanobot.cli.webui_support.inspect_webui_bundle",