[PR #7194] [MERGED] hotfix(termux): keep 2.5.0 Android installs running (sharp runtime) and refresh the APK #7617

Closed
opened 2026-10-24 04:05:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7194
Author: @SpicyMarinara
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @SpicyMarinara

Base: main ← Head: hotfix/termux-2.5.0-fixes


📝 Commits (10+)

  • ab6f3f9 fix(termux): keep the server up when sharp's WebAssembly runtime is missing (#7173, #7189)
  • 2ec45b4 docs: Termux image library repair and crash note (#7173)
  • d1f3563 docs: existing thumbnails still show while Sharp cannot load (#7173)
  • a3b74c4 docs: only the built-in background removal needs Sharp (#7173)
  • d6b2feb chore(android): bump versionCode to 49 for the refreshed 2.5.0 APK
  • 25f464f fix(chat): keep chat controls off other screens and let the Agents button close its panel
  • 11e6eb4 test(e2e): make the covered-chat regression's return step deterministic
  • 27b3d5f test(e2e): cover a pinned chat window behind covering screens
  • 4828ebb fix(chat): move keyboard focus into the Tracker Panel when it covers the chat
  • 4fe3965 docs: the Tracker Panel button opens and closes the panel (#7176)

📊 Changes

19 files changed (+504 additions, -55 deletions)

View changed files

📝 android/app/build.gradle (+1 -1)
📝 docs/TROUBLESHOOTING.md (+17 -2)
📝 docs/chats/chat-settings.md (+1 -1)
📝 docs/roleplay/hud-and-trackers.md (+1 -1)
➕ e2e/chat-controls-covered.e2e.ts (+229 -0)
📝 e2e/message-trash-batching.e2e.ts (+41 -12)
📝 e2e/phone-bubbles.e2e.ts (+1 -1)
📝 e2e/tracker-window-routing.e2e.ts (+1 -1)
📝 packages/client/src/components/chat/TrackerPanelBubble.tsx (+9 -4)
📝 packages/client/src/components/layout/AppShell.tsx (+13 -1)
📝 packages/client/src/styles/globals.css (+6 -0)
📝 packages/server/package.json (+1 -0)
📝 packages/server/src/index.ts (+8 -0)
📝 packages/server/src/services/image/sharp-runtime.ts (+20 -0)
📝 pnpm-lock.yaml (+3 -0)
➕ scripts/regressions/sharp-wasm-runtime-missing.regression.ts (+58 -0)
➕ scripts/regressions/termux-native-deps.regression.mjs (+65 -0)
📝 scripts/regressions/termux-sharp.regression.mjs (+25 -0)
📝 start-termux.sh (+4 -31)

📄 Description

Linked issue

Refs #7173, #7189 (both closed as fixed on staging by #7179), #7176 parts 1–2 (fixed on staging by #7181) and #7178 (#7198).

Why this change

On v2.5.0, Termux installs updated in place from 2.4.6 crash the server on the first image request (a background or gallery thumbnail), so Engine is unusable on Android (#7173, #7189). The fix is on staging, but:

  • command-line Termux installs update to origin/main, and
  • the Android APK pins the exact commit it was built from (MARINARA_RELEASE_COMMIT) and starts Engine with --skip-update.

So the fix only reaches Android users if it is on main and the APK is rebuilt from that commit. This is a hotfix to main without a new tag or release. Afterwards the 2.5.0 APK assets on the release page will be replaced with a build from this commit.

What changed

  • Termux sharp crash (cherry-picked from #7179):
    • @emnapi/runtime is now a direct server dependency, so pnpm installs it even where a 2.4.6-era install recorded it as skipped (lockfile +3 lines).
    • A failed start of sharp's WebAssembly runtime now turns image processing off instead of stopping the server (isSharpLoaderRejection in the unhandled-rejection handler).
    • The termux-sharp regression gains a lockfile assertion, plus the new sharp-wasm-runtime-missing regression.
  • Docs (cherry-picked from #7183): a Termux troubleshooting section with the manual repair.
  • Chat controls on Android tablets and foldables (cherry-picked from #7181, #7176): at widths between the phone and desktop layouts, the chat's floating buttons and windows no longer draw over other screens (Agents editor Save/close, Tracker Panel). The Tracker Panel button now opens and closes the panel, and keyboard focus moves into the panel. Includes its e2e regression and the two guide updates.
  • Faster Termux starts (cherry-picked from #7198, #7178): removes start-termux.sh's dead .npmrc architecture block. pnpm 10 ignored those lines, and because the APK's setup git checkout -f wiped them, every start from the Android app re-ran pnpm store prune and a full dependency install. Includes the termux-native-deps regression.
  • Android: versionCode 49 (versionName stays 2.5.0), so phones install the rebuilt APK as an update.
  • CHANGELOG entries are not duplicated here; they ship with the next release from staging.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Agent-run checks on this branch: pnpm check; chat-controls-covered, phone-bubbles and tracker-window-routing e2e on desktop-chromium and mobile-webkit: 21 passed, with one failure in phone-bubbles › "large themed tools scroll inside a short phone viewport". That test also fails 1 run in 3 on untouched main, so it is pre-existing flakiness, not this change; sharp-wasm-runtime-missing, termux-sharp, termux-postmortem and server-signal-shutdown regressions all pass; pnpm version:check is in sync for 2.5.0. #7179's verifier replayed the real 2.4.6 → fix update with pnpm 10.34.5 and Termux-like --os linux --cpu arm64 --cpu wasm32.

Manual verification notes

  • Manually verify on an Android phone: install the rebuilt APK over the current 2.5.0 APK (it must install as an update), start Engine, open a chat with backgrounds and the gallery, and confirm the server stays up and thumbnails load.
  • Manually verify on a command-line Termux install updated from 2.4.6 that ./start-termux.sh updates to this commit and the server no longer exits on the first image.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation) — #7185
  • Version/release files updated (only if this PR includes a version bump)

Summary by CodeRabbit

  • New Features
    • On phones and tablets, the Tracker Panel button now opens and closes the panel. Chat controls are hidden while covered by the panel or another screen, and focus moves into the panel when needed.
  • Bug Fixes
    • Improved handling of Sharp failures on Android. If image processing cannot load, the server remains available; existing thumbnails remain visible, while new thumbnails use full-size images. Sprite generation and built-in background removal may be unavailable.
    • Updated Termux troubleshooting guidance with steps to address Sharp loading failures.
  • Other
    • Increased the Android app version.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7194 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `hotfix/termux-2.5.0-fixes` --- ### 📝 Commits (10+) - [`ab6f3f9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ab6f3f9ca694443498f5175ca807e96a17e8bf2b) fix(termux): keep the server up when sharp's WebAssembly runtime is missing (#7173, #7189) - [`2ec45b4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2ec45b413dac9f54c3fe21614c125f1e4d18d0f4) docs: Termux image library repair and crash note (#7173) - [`d1f3563`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d1f3563fbce99c83bee6d5f821241a9b316c94a8) docs: existing thumbnails still show while Sharp cannot load (#7173) - [`a3b74c4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a3b74c4577ed99c681c21a4392061c9be42926c7) docs: only the built-in background removal needs Sharp (#7173) - [`d6b2feb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d6b2feb91dcd3a515592455d008c3b66da683fac) chore(android): bump versionCode to 49 for the refreshed 2.5.0 APK - [`25f464f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/25f464f92c34502404f7c6a48a735e9f7c0d9eec) fix(chat): keep chat controls off other screens and let the Agents button close its panel - [`11e6eb4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/11e6eb4b2ca295b363465c1be1a6b806130ac7fb) test(e2e): make the covered-chat regression's return step deterministic - [`27b3d5f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/27b3d5f8bc4934e0151d182c0f340071da9d4559) test(e2e): cover a pinned chat window behind covering screens - [`4828ebb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4828ebb26b1add5a2d919a20d8f2b117e964ed6d) fix(chat): move keyboard focus into the Tracker Panel when it covers the chat - [`4fe3965`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4fe3965f3d435c464d92c03226b3693358e660c5) docs: the Tracker Panel button opens and closes the panel (#7176) ### 📊 Changes **19 files changed** (+504 additions, -55 deletions) <details> <summary>View changed files</summary> 📝 `android/app/build.gradle` (+1 -1) 📝 `docs/TROUBLESHOOTING.md` (+17 -2) 📝 `docs/chats/chat-settings.md` (+1 -1) 📝 `docs/roleplay/hud-and-trackers.md` (+1 -1) ➕ `e2e/chat-controls-covered.e2e.ts` (+229 -0) 📝 `e2e/message-trash-batching.e2e.ts` (+41 -12) 📝 `e2e/phone-bubbles.e2e.ts` (+1 -1) 📝 `e2e/tracker-window-routing.e2e.ts` (+1 -1) 📝 `packages/client/src/components/chat/TrackerPanelBubble.tsx` (+9 -4) 📝 `packages/client/src/components/layout/AppShell.tsx` (+13 -1) 📝 `packages/client/src/styles/globals.css` (+6 -0) 📝 `packages/server/package.json` (+1 -0) 📝 `packages/server/src/index.ts` (+8 -0) 📝 `packages/server/src/services/image/sharp-runtime.ts` (+20 -0) 📝 `pnpm-lock.yaml` (+3 -0) ➕ `scripts/regressions/sharp-wasm-runtime-missing.regression.ts` (+58 -0) ➕ `scripts/regressions/termux-native-deps.regression.mjs` (+65 -0) 📝 `scripts/regressions/termux-sharp.regression.mjs` (+25 -0) 📝 `start-termux.sh` (+4 -31) </details> ### 📄 Description ## Linked issue Refs #7173, #7189 (both closed as fixed on `staging` by #7179), #7176 parts 1–2 (fixed on `staging` by #7181) and #7178 (#7198). ## Why this change On v2.5.0, Termux installs updated in place from 2.4.6 crash the server on the first image request (a background or gallery thumbnail), so Engine is unusable on Android (#7173, #7189). The fix is on `staging`, but: - command-line Termux installs update to `origin/main`, and - **the Android APK pins the exact commit it was built from** (`MARINARA_RELEASE_COMMIT`) and starts Engine with `--skip-update`. So the fix only reaches Android users if it is on `main` **and** the APK is rebuilt from that commit. This is a hotfix to `main` without a new tag or release. Afterwards the 2.5.0 APK assets on the release page will be replaced with a build from this commit. ## What changed - **Termux sharp crash (cherry-picked from #7179):** - `@emnapi/runtime` is now a direct server dependency, so pnpm installs it even where a 2.4.6-era install recorded it as skipped (lockfile +3 lines). - A failed start of sharp's WebAssembly runtime now turns image processing off instead of stopping the server (`isSharpLoaderRejection` in the unhandled-rejection handler). - The termux-sharp regression gains a lockfile assertion, plus the new `sharp-wasm-runtime-missing` regression. - **Docs (cherry-picked from #7183):** a Termux troubleshooting section with the manual repair. - **Chat controls on Android tablets and foldables (cherry-picked from #7181, #7176):** at widths between the phone and desktop layouts, the chat's floating buttons and windows no longer draw over other screens (Agents editor Save/close, Tracker Panel). The Tracker Panel button now opens and closes the panel, and keyboard focus moves into the panel. Includes its e2e regression and the two guide updates. - **Faster Termux starts (cherry-picked from #7198, #7178):** removes `start-termux.sh`'s dead `.npmrc` architecture block. pnpm 10 ignored those lines, and because the APK's setup `git checkout -f` wiped them, every start from the Android app re-ran `pnpm store prune` and a full dependency install. Includes the `termux-native-deps` regression. - **Android:** `versionCode` 49 (`versionName` stays 2.5.0), so phones install the rebuilt APK as an update. - CHANGELOG entries are not duplicated here; they ship with the next release from `staging`. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Agent-run checks on this branch: `pnpm check`; `chat-controls-covered`, `phone-bubbles` and `tracker-window-routing` e2e on desktop-chromium and mobile-webkit: 21 passed, with one failure in `phone-bubbles` › "large themed tools scroll inside a short phone viewport". That test also fails 1 run in 3 on untouched `main`, so it is pre-existing flakiness, not this change; `sharp-wasm-runtime-missing`, `termux-sharp`, `termux-postmortem` and `server-signal-shutdown` regressions all pass; `pnpm version:check` is in sync for 2.5.0. #7179's verifier replayed the real 2.4.6 → fix update with pnpm 10.34.5 and Termux-like `--os linux --cpu arm64 --cpu wasm32`. ### Manual verification notes - Manually verify on an Android phone: install the rebuilt APK over the current 2.5.0 APK (it must install as an update), start Engine, open a chat with backgrounds and the gallery, and confirm the server stays up and thumbnails load. - Manually verify on a command-line Termux install updated from 2.4.6 that `./start-termux.sh` updates to this commit and the server no longer exits on the first image. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) — #7185 - [ ] Version/release files updated (only if this PR includes a version bump) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * On phones and tablets, the Tracker Panel button now opens and closes the panel. Chat controls are hidden while covered by the panel or another screen, and focus moves into the panel when needed. * **Bug Fixes** * Improved handling of Sharp failures on Android. If image processing cannot load, the server remains available; existing thumbnails remain visible, while new thumbnails use full-size images. Sprite generation and built-in background removal may be unavailable. * Updated Termux troubleshooting guidance with steps to address Sharp loading failures. * **Other** * Increased the Android app version. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:05:54 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7617
No description provided.