Skip to content

release: 0.4.1 — stop downloading the browser runtime from a private release - #13

Merged
cmjang merged 1 commit into
mainfrom
release/0.4.1
Nov 4, 2026
Merged

cmjang merged 1 commit into
mainfrom
release/0.4.1

Conversation

@cmjang

@cmjang cmjang commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

变更

修掉 PyPI 0.4.0 的一个致命问题:_browser_runtime.py 把浏览器运行时的下载地址硬编码成 https://github.com/OpenLegged/botlab-python/releases/download/v<version>/botlab-browser-runtime-<version>.zip,而本仓库是 private,于是干净安装后第一次 botlab run / 带预览的 run --out / build --site 全部 404,用户没有任何本地绕法(0.4.0 的文案只提 ui fetch --archive,但 archive 本身只有 GitHub Release 上有)。

浏览器运行时归前端:它由 BotLab checkout 构建并发布,Python 包只做消费方。0.4.1 把这条边界落到代码里,并去掉编译进 wheel 的私有地址:

  • browser_runtime_url() 改为读 BOTLAB_RUNTIME_URL,未设置时返回 None;包里不再有任何写死的下载地址。
  • fetch_browser_runtime() 无源时直接报错,一次说清两条本地安装路径(botlab ui sync --botlab <checkout> / botlab ui fetch --archive <zip>)和镜像开关;ensure_browser_runtime() 不再把这条消息包第二层。
  • 配了镜像(BOTLAB_RUNTIME_URL 或 ui fetch --url)仍可自动下载;下载失败文案也改指向本地两条路径。
  • ui fetch --url 的帮助文本、README 的运行时章节与命令表同步到新边界,示例里的版本号改成 <version>,不再随发版过期。
  • 版本升到 0.4.1(pyproject.toml、src/botlab/__init__.py、uv.lock)。

不受影响:--native、--headless、validate、普通 build(release.zip)从不需要浏览器运行时;已验证的运行时缓存照旧复用。

验证

  • uv run ruff check . → All checks passed
  • uv run pytest(3.12)→ 1289 tests, 0 failed, 10 skipped;3.13 全新 venv 重跑同样全绿
  • 新增用例 test_missing_runtime_without_a_source_names_both_local_installs 固定住「无源时报错必须同时给出 ui sync --botlab、ui fetch --archive、BOTLAB_RUNTIME_URL」;test_ensure_downloads_once_and_reuses_verified_cache 改成断言镜像 URL 就是 BOTLAB_RUNTIME_URL
  • 候选 wheel botlab_python-0.4.1-py3-none-any.whl(sha256 60ba1216…)过 scripts/verify_wheel.py:PASS,含 docs、ui status、validate、真实 run --headless、build、--native viewer、ui fetch --archive、build --site
  • 从候选 wheel 的 venv 里验三条真实路径:
    • 空缓存 + 无 BOTLAB_RUNTIME_URL → botlab run 退出码 2,报错给出上面三条出路
    • BOTLAB_RUNTIME_URL=file://…/botlab-browser-runtime-0.4.1.zip → 真实下载并装进缓存后正常起服务
    • 浏览器验收(build --site 产物,嵌套 URL、无跨源隔离头、crossOriginIsolated:false):画面在动、拖拽生效、0 console error,证据在 tmp/pypi-0.4.1-acceptance/

风险

  • 0.4.0 已发布且无法撤回(下载地址编译进了 wheel),修复只能走 0.4.1;不装 0.4.1 的用户仍会撞 404。
  • 行为变化:干净机器上 botlab run 不再「自己想办法下载」,而是要求先 ui sync / ui fetch --archive。这是有意的,但属于用户可见的默认路径改变,README 与报错文案都写明了。
  • 运行时 archive 的 manifest 版本必须等于 botlab.__version__,所以 botlab-browser-runtime-0.4.1.zip 需用 0.4.1 代码重新 ui sync + ui export;0.4.0 的 zip 会被版本校验拒收(前端字节未变,仅 manifest 版本不同)。
  • BotLab 侧(botlab.enkeebot.com、/d/ 宿主)本次不动,运行时仍由前端自己分发。

0.4.0 pinned a download URL to this repository's GitHub releases, but the
repository is private, so a fresh install could not obtain the browser
runtime and every `botlab run` / `build --site` failed after 404s.

The browser runtime belongs to the BotLab frontend: it is built from a
BotLab checkout and published there. The Python package now only consumes
it and never hosts or downloads it by default:

- `browser_runtime_url()` reads `BOTLAB_RUNTIME_URL` and returns None when
  it is unset, so there is no compiled-in fallback address.
- A missing runtime stops the command with the two local installs
  (`ui sync --botlab <checkout>`, `ui fetch --archive <zip>`) instead of an
  opaque download error; `ensure_browser_runtime()` no longer wraps that
  message in a second layer.
- A configured mirror still works through `BOTLAB_RUNTIME_URL` or
  `ui fetch --url`, and download failures suggest the local paths.
- README states the ownership boundary and stops pinning a version in the
  examples.

Version 0.4.1.
@cmjang
cmjang merged commit 693fbc2 into main Nov 4, 2026
3 checks passed
carlvon17 added a commit that referenced this pull request Nov 5, 2026
release/0.4.0 was squash-merged as #12 (62 files, 14418+/526-); the remaining
tree delta vs this branch is exactly #13 (68+/46-) plus the v3 SDK sync
(1034+/217-), i.e. 1102+/263- with zero drift. Recorded with -s ours so the
branch history is reachable from main and the ref can be retired; also covers
merge/local-wip-20261028 and feat/localized-labels (both ancestors of this
branch).

Co-Authored-By: Claude Code <noreply@anthropic.com>
@carlvon17
carlvon17 deleted the release/0.4.1 branch November 5, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant