Push261104 — Terminal fixes + wrapper backfill (v2 2.0.0→2.2.5, v1 1.18.30→1.19.5)
English · 中文版 · 繁體中文 · 日本語 · Español
Overview
Two functional fixes plus a full backfill of both wrapper families. Both fixes
are in the "everything looks green but the feature never works" class: the TUI
and the HTTP server are healthy, and only the code path that actually opens a
terminal or reads a keystroke is broken.
v2 native 2.2.5-2 — PTY creation. POST /api/pty always returned
500 ERR_DLOPEN_FAILED. The TUI, serve and the Web UI were fine; only opening
a terminal (a TUI pane, a remote client attaching to PTY, /goal-style
operations) failed. Root cause: the embedded librust_pty was a glibc build and
bionic has no libpthread.so.0. The musl + symbol-shim route was tried and
rejected — it dlopens, but Bun then takes SIGSEGV@0x0 inside POST /api/pty,
because musl's runtime expectations far exceed what a handful of shimmed symbols
can cover. The fix compiles the bun-pty Rust crate natively for
aarch64-linux-android (540 KB; needs the termios 0.2.2 android cfg and a
static libunwind.a).
v1 native 1.19.4-2 — TUI is display-only. The TUI printed
^[]10;rgb:…, ^[[?1016;0$y, ^[P0+r4d73^[\ on entry and echoed mouse
reports as 0;108;22M. Not a parser problem: the launcher ran the TUI in a
background process group (so it could capture crash stderr for SIGSEGV), which
means the TUI never held the terminal foreground and never left canonical/echo
mode (stty reads isig icanon echo). Keys needed Enter to arrive, and the
terminal's replies to startup probes were echoed back as junk. Fix: run the
launcher in the foreground (crash logging and exit codes unchanged), plus an
equal-length binary guard that generalises opentui's CPR guard into "drop
everything after a second ESC", so Termux cannot concatenate probe replies into
the input stream.
Wrapper backfill. v2 opencode-wrapper previously covered only
2.0.23–2.0.27 and v1 opencode1-wrapper only 1.18.32–1.19.4. Both are now
continuous: v2 2.0.0–2.2.5, v1 1.18.30–1.19.5, each version as deb +
pacman. Two real pipeline defects were fixed along the way: family-v2-wrapper
never fetched the glibc tarball (it only expected it to exist, so 2.1.x/2.2.x
all failed with RC=2), and wrapper-native hardcoded package/bin/opencode
while 2.0.19–2.0.22 ship a different in-archive layout. The mis-named
opencode1-wrapper_2.1.* / 2.2.* packages (v2 versions packed by the v1
script) were removed.
120 assets: v2 native opencode 2.2.5 (PKGREL 2) and v1 native opencode1
1.19.4 (PKGREL 2), deb + pacman .pkg.tar.xz (4); v2 wrapper
opencode-wrapper 2.0.0–2.2.5, 43 versions deb + pacman (86); v1 wrapper
opencode1-wrapper 1.18.30–1.19.5, 12 versions deb + pacman (24); SHA256SUMS.txt
(native) and SHA256SUMS-wrappers.txt (110 wrapper packages). The four repo
artifacts on this tag (hope2333.db, hope2333.db.tar.gz, 2 mirrorlist files)
are published by the site CI.
| Family | Generation | Package | Format | Notes |
|---|---|---|---|---|
| native (mainline) | v2 | opencode
| deb + pacman .pkg.tar.xz
| 2.2.5 PKGREL 2 — bionic-native librust_pty; PTY creation works
|
| native (mainline) | v1 | opencode1
| deb + pacman .pkg.tar.xz
| 1.19.4 PKGREL 2 — foreground launcher; TUI input works |
| wrapper (appendix) | v2 | opencode-wrapper
| deb + pacman | 2.0.0–2.2.5 complete; exact --version gate per build
|
| wrapper (appendix) | v1 | opencode1-wrapper
| deb + pacman | 1.18.30–1.19.5 complete |
Mutual exclusion: across generations opencode1 (v1) and opencode (v2) CAN
coexist side by side; within one generation install exactly ONE of native /
wrapper / compressed.
Not in this batch: compressed/UPX lines, and v1 native 1.19.5 (see Known Issues).
Install
curl -fsSL https://hope2333.github.io/repo/install.sh | sh -s -- --install opencode
pacman -S opencode # v2 mainline (or opencode-wrapper)
pacman -S opencode1 # v1 mainline (coexists with v2)Manual (pinned):
pacman -U opencode-2.2.5-2-aarch64.pkg.tar.xz # v2 native
pacman -U opencode1-1.19.4-2-aarch64.pkg.tar.xz # v1 native
dpkg -i opencode_2.2.5-2_aarch64.deb
dpkg -i opencode1_1.19.4-2_aarch64.debBUILD LOG
20261104: v2 native 2.2.5-2 — PTY fix; musl+shim attempted and rejected (dlopen ok, SIGSEGV@0x0 inside POST /api/pty); bun-pty Rust crate rebuilt for aarch64-linux-android (termios android cfg + static libunwind.a)
20261104: v1 native 1.19.4-2 — launcher moved to the foreground process group (raw mode restored); reply-batch ESC guard added before UPX
20261104: wrapper backfill (v2) — 2.0.19–2.0.22, 2.1.0–2.1.4, 2.2.0–2.2.5; pipeline fixes: auto npm pack when the glibc tgz is missing, in-archive binary lookup for legacy layouts (commit 4f31824)
20261104: wrapper backfill (v2) — 2.0.0–2.0.18, 2.0.28–2.0.31 completed after freeing disk (17 versions had failed with tar: Wrote only N bytes)
20261104: wrapper backfill (v1) — 1.18.30–1.19.3 gap-fill plus 1.19.5 (12 versions, deb + pacman)
20261104: mis-named opencode1-wrapper_2.1.* / 2.2.* (deb + pacman) removed
20261104: opencode1 1.19.5 native WITHDRAWN — see Known Issues; the deb and pacman packages were removed from this tag after failing the runtime check
Latest: v2.2.5 (v2) / v1.19.4 (v1)
Verification
- Android 9 / kernel 3.18.140 (device oscar):
POST /api/ptyreturns a live
zsh(status: running); serve / TUI / keystroke / 15 s all pass — v2
regression clean - Android 16 / kernel 6.6.118 (host):
opencode v2.2.5 --version;serve
starts;POST /api/ptyreturns a running process with a pid — the PTY fix
holds on the newer platform - v1 input:
sttyreads-icanonafter launch; keystrokes reach the input
box without Enter; first screen contains norgb:/$yjunk - wrapper version gate: every v2 wrapper build asserts
--versionequals the
target version exactly — 43/43 pass; disk-exhaustion failures
(tar: Wrote only N bytes) were re-run, not waived - package payload gate: the finished package is unpacked and its runtime
binary is executed, asserting--versionmatches. The gate deliberately targets
the runtime, notusr/bin/*— the launcher hardcodes absolute$PREFIXpaths,
so running it from an unpacked tree execs the host's installed binary and
reports the installed version instead of the packaged one - asset reconciliation: remote
digestcompared against localsha256sum
output for every uploaded asset (not sampled) — 0 missing, 0 mismatch
Known Issues
- v1 native
1.19.5is withdrawn. The revive pipeline produces a binary that
starts but segfaults (Segmentation fault at address 0x40) on both Android 9 /
3.18.140 and Android 16 / 6.6.118. Grafting the 1.19.5 module graph onto a 1.4.0
bun base corrupts the payload (SyntaxError: Invalid character: '\0'), while a
1.4.2 base yields a binary that reports the right version and then crashes —
1.4.2 is known to fault at0x40on bionic (issue #23). The v11.19.5
wrapper package is unaffected and is available. - The two bun bases are not interchangeable. The revive path (A line: graft a
module graph) and the compile path (B line: bun runs the build) need different
versions. Both are recorded intools/transplant/config/bun-bind.jsonas
revive_target/compile_target. - Android 11+ coverage is limited. Primary verification remains Android 9;
this batch adds a PTY smoke test on Android 16. Full TUI interaction should
still be judged on Android 9 / 3.18. - wrapper is the appendix line. Prefer native when available; within one
generation wrapper and native are mutually exclusive, v1 and v2 coexist.
Links
- GitHub: https://github.com/Hope2333/opencode-termux
- Software source guide: https://hope2333.github.io/wiki/guides/software-source.html