hope2333.github.io / wiki

Push261105


Push261105 — v2 web UI archive repair (2.0.25→2.0.31) + v1 1.19.5 native restored

GitHub Release · 中文版 · English · Español · 日本語 · 繁體中文

Overview

Two native-line repairs in this batch: a silent web UI archive regression that affected every v2 release from 2.0.25 to 2.0.31, and the restoration of v1 native 1.19.5, which was withdrawn in the previous batch.

16 packages: 14 v2 + 2 v1 (deb + pacman per version), plus a SHA256SUMS manifest.

v2: web UI archive regression

Upstream 2.0.25 rewrote the skipBuild guard in app-assets.ts. The old exact-string anchor silently stopped matching, so the patch was skipped and the built runtime shipped with zero embedded /_assets/ entries. serve and pair then returned 404 for every /_assets/* request — the web UI showed a white screen after login. Nothing else failed; the TUI kept working, which is exactly why this slipped through.

The fix has three layers:

  1. a regex anchor instead of an exact match, so formatting drift upstream no longer breaks the patch;
  2. a hard failure when the anchor is missing — no more silent skip;
  3. a post-build strings assertion that the runtime actually embeds the assets.

Self-check on an installed v2 native package:

strings -a $PREFIX/bin/opencode | grep -c '/_assets/'
# must be > 0 — this batch ships 7 on every version

v1: 1.19.5 restored

v1 native 1.19.5 was withdrawn in the previous batch. Root cause: bun ≥1.4.1 writes module graphs containing UTF-16 bodies (encoding=2) and 38 Text loader modules, and the bun 1.4.0 base understands neither — the former crashes with Invalid character '\0', the latter with Unexpected identifier.

The fix is a graph post-processor, tools/transplant/fix_graph_for_bun140.py: UTF-16 bodies are converted to UTF-8, Text modules are rewritten as export default "...", consumption points get a namespace shim, and relocated modules are parked in a dead zone. No bun recompile, and no dependency on upstream bun#47906 (the issue is still open).

v1 PTY splice

v1 native packages now bundle the PTY splice (lib/opencode1/pty/{librust_pty_arm64_musl_patched.so, shim.so}), so POST /api/pty works. Native packages without the splice returned 500.

Compatibility

Verification

Check Result
strings -a <runtime> | grep -c '/_assets/' on v2 2.0.25–2.0.31 7 per version
serve serves /_assets/* with 200 pass
v1 1.19.5 TUI renders on screen pass
v1 1.19.5 POST /api/pty returns a running process pass

Install

curl -fsSL https://hope2333.github.io/repo/install.sh | sh -s -- --install opencode

pacman -S opencode     # v2 mainline
pacman -S opencode1    # v1 mainline (coexists with v2)

Known Issues