Repository navigation
Push261104 — PTY / v1 TUI 修复 + wrapper 双代全量补齐
Overview
两个功能性修复,加两条 wrapper 家族的全量补齐。这批的重点不是"又发了几个版本",而是两类静默失效:界面正常、服务正常,只有真正用到终端或按键时才暴露。
v2 native 2.2.5-2 —— PTY 起不来。 POST /api/pty 恒返 500 ERR_DLOPEN_FAILED。TUI、serve、Web UI 全部正常,只有开终端(TUI 内 pane、远程客户端连 PTY、/goal 一类需要终端的操作)失败。根因是内嵌的 librust_pty 是 glibc 构建,bionic 没有 libpthread.so.0。musl + 符号 shim 这条路试过并放弃:能 dlopen,但 Bun 在 POST /api/pty 时 SIGSEGV@0x0——musl 的运行时预期远超 shim 能覆盖的符号数。最终改为为本机直接编译:host 即 aarch64-linux-android,把 bun-pty 的 Rust crate 编成 bionic 件(540 KB),只需补 termios 0.2.2 的 android cfg 与静态链接 libunwind.a。
v1 native 1.19.4-2 —— TUI 只显示不能操作。 进 TUI 就吐 ^[]10;rgb:…、^[[?1016;0$y、^[P0+r4d73^[\,鼠标点击回显成 0;108;22M。不是解析器问题:启动器为了捕获 SIGSEGV 崩溃 stderr,把 TUI 放在后台进程组("$OC_RT" ... & + wait),它永远拿不到终端前台权,raw 模式设不上(stty 实测 isig icanon echo 全开)——按键要回车才送达,终端对启动探测的应答被 tty 回显成垃圾。修法是启动器改前台运行(崩溃记录与退出码不变),另加一条等长的二进制守卫把 opentui 的 CPR 守卫泛化为"出现第二个 ESC 就丢弃",防 Termux 把探测应答粘成一坨。
wrapper 双代补齐。 v2 opencode-wrapper 补齐到 2.0.0 起全连续(此前只有 2.0.23–2.0.27),v1 opencode1-wrapper 补齐到 1.18.30 起全连续并新增 1.19.5;两代均为每版 deb + pacman 双格式。补齐过程修掉两个真实管线缺陷:family-v2-wrapper 从不获取 glibc tgz(只"期望"它已存在,2.1.x/2.2.x 因此全线 RC=2),wrapper-native 硬编码 package/bin/opencode(2.0.19–2.0.22 包内布局不同,tar 直接失败)。同时清理了此前误命名的 opencode1-wrapper_2.1.*/2.2.*(v2 版本被 v1 脚本打包)与对应的 pacman 残留。
116 assets: v2 native opencode 2.2.5 (PKGREL 2) + 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)与 SHA256SUMS-wrappers.txt(wrapper 110 packages)。
| Family | Generation | Package | Format | Notes |
|---|---|---|---|---|
| native (mainline) | v2 | opencode |
deb + pacman .pkg.tar.xz |
2.2.5 PKGREL 2 — bionic-native librust_pty, PTY fixed |
| native (mainline) | v1 | opencode1 |
deb + pacman .pkg.tar.xz |
1.19.4 PKGREL 2 — foreground launcher, TUI input fixed |
| 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 the same generation install exactly ONE of native / wrapper / compressed.
Not in this batch: opencode1 1.19.5 native (transplant pipeline blocks it — see BUILD LOG), compressed/UPX lines.
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 on POST /api/pty); rebuilt bun-pty Rust crate for aarch64-linux-android (termios android cfg + static libunwind.a)
20261104: v1 native 1.19.4-2 — launcher moved to 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 for missing glibc tgz, 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 on tar: Wrote only N bytes)
20261104: wrapper backfill (v1) — 1.18.30–1.19.3 gap-fill + 1.19.5 new (12 versions, deb + pacman)
20261104: mis-named opencode1-wrapper_2.1.* / 2.2.* (deb + pacman) removed; they were v2 versions packed by the v1 script
20261104: opencode1 1.19.5 native BLOCKED — transplant verify fails SyntaxError: Invalid character: '\0' (revived 191 MB from a 211 MB official ELF); pin row added, build deferred
Latest: v2.2.5 (v2) / v1.19.4 (v1)
Verification
- Android 9 / kernel 3.18.140 (oscar):
POST /api/ptyreturns a livezsh(status: running); serve / TUI / keystroke / 15 s all pass — v2 regression clean - Android 16 / kernel 6.6.118 (host device):
opencode v2.2.5 --versionOK;servestarts;POST /api/ptyreturns a live process (status: running, pid assigned) — the PTY fix holds on the newer platform - v1 input:
sttyreads-icanonafter launch; keystrokes reach the input box without Enter; first screen has 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 - Asset reconciliation: remote
digestcompared against localsha256sumoutput for every uploaded asset (not sampled) — 0 missing, 0 mismatch - v1 wrapper: 1.19.2 build returned non-zero on the trailing
clean-versionstep only; both deb and pacman payloads were produced and verified
Links
- GitHub: https://github.com/Hope2333/opencode-termux
- Software source guide: https://hope2333.github.io/wiki/guides/software-source.html