From 89d35863d952ef733cbb812fbd0ef2ea32d4dae1 Mon Sep 17 00:00:00 2001 From: Xubin Ren <52506698+Re-bin@users.noreply.github.com> Date: Tue, 27 Oct 2026 23:42:48 +0800 Subject: [PATCH] fix(webui): reinstall locked dependencies when rebuilding source upgrades --- nanobot/webui/build.py | 4 +++- tests/webui/test_build.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) 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: