fix(cli): skip WebUI bundle check in dev mode
This commit is contained in:
1 parent
63cc5f270d
commit
c08172a641
3 files changed
+8
-6
No files matched your search
@@ -216,11 +216,9 @@ def webui(
|
|||||||
f"{config_path}, or rerun without --no-open to open the authenticated URL.[/dim]"
|
f"{config_path}, or rerun without --no-open to open the authenticated URL.[/dim]"
|
||||||
)
|
)
|
||||||
|
|
||||||
webui_bundle_mode = _webui_build_mode_for_interactive(yes=yes)
|
if not dev:
|
||||||
_prepare_webui_bundle_for_gateway(
|
webui_bundle_mode = _webui_build_mode_for_interactive(yes=yes)
|
||||||
runtime_config,
|
_prepare_webui_bundle_for_gateway(runtime_config, mode=webui_bundle_mode)
|
||||||
mode="skip" if dev else webui_bundle_mode,
|
|
||||||
)
|
|
||||||
|
|
||||||
instance = GatewayInstance.resolve(
|
instance = GatewayInstance.resolve(
|
||||||
config_path=config_path,
|
config_path=config_path,
|
||||||
|
|||||||
@@ -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)
|
monkeypatch.setattr("nanobot.cli.webui.run_webui_dev_server", fake_dev_server)
|
||||||
_patch_webui_managed_gateway(monkeypatch, seen)
|
_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(
|
monkeypatch.setattr(
|
||||||
"nanobot.cli.webui._attach_to_background_gateway",
|
"nanobot.cli.webui._attach_to_background_gateway",
|
||||||
lambda runtime, **kwargs: seen.update(
|
lambda runtime, **kwargs: seen.update(
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ def test_source_checkout_preserves_warn_only_gateway_startup(monkeypatch) -> Non
|
|||||||
assert modes == ["warn"]
|
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] = []
|
modes: list[str] = []
|
||||||
monkeypatch.setattr(
|
monkeypatch.setattr(
|
||||||
"nanobot.cli.webui_support.inspect_webui_bundle",
|
"nanobot.cli.webui_support.inspect_webui_bundle",
|
||||||
|
|||||||
Reference in new issue
Block a user