diff --git a/nanobot/webui/build.py b/nanobot/webui/build.py index d773f6325..458d8c036 100644 --- a/nanobot/webui/build.py +++ b/nanobot/webui/build.py @@ -192,8 +192,10 @@ def build_webui_bundle( using_bun = Path(command_runner).stem.lower() == "bun" _emit(output, f"Building bundled WebUI with `{command_runner}`...") + # Reinstall the locked tree: Bun's incremental install can retain the old + # hoisting layout after a source upgrade and omit new nested major versions. _run_frontend_command( - [command_runner, "install", *(["--frozen-lockfile"] if using_bun else [])], + [command_runner, "install", *(["--frozen-lockfile", "--force"] if using_bun else [])], cwd=resolved_source, subprocess_run=subprocess_run, ) diff --git a/tests/webui/test_build.py b/tests/webui/test_build.py index b35b5d0ed..41cd8b42b 100644 --- a/tests/webui/test_build.py +++ b/tests/webui/test_build.py @@ -128,7 +128,8 @@ def test_ensure_webui_bundle_auto_builds_stale_dist(tmp_path: Path, monkeypatch) ) assert status.stale is False - assert commands == [("bun", "install", "--frozen-lockfile"), ("bun", "--bun", "run", "build")] + assert commands == [("bun", "install", "--frozen-lockfile", "--force"), + ("bun", "--bun", "run", "build")] def test_pick_webui_build_runner_returns_resolved_executable(monkeypatch) -> None: