fix(cli): skip WebUI bundle check in dev mode

This commit is contained in:
chengyongru authored and chengyongru committed 2026-09-05 22:39:55 +08:00
1 parent 63cc5f270d
commit c08172a641
3 files changed
+8 -6

No files matched your search

+3 -5
View File
@@ -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,
+4
View File
@@ -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(
+1 -1
View File
@@ -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",