[PR #122] [MERGED] Harden sidecar runtime startup and recovery #4474

Closed
opened 2026-10-22 04:07:56 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/122
Author: @ghost
Created: 4/19/2026
Status: ✅ Merged
Merged: 4/20/2026
Merged by: @SpicyMarinara

Base: main ← Head: fix/sidecar-runtime-recovery


📝 Commits (4)

  • b6b5355 Harden sidecar runtime startup and recovery
  • 33608d1 Merge origin/main into fix/sidecar-runtime-recovery
  • fb13b2d Improve sidecar diagnostics and local test message
  • 7f676b4 Fix sidecar Docker runtime startup

📊 Changes

13 files changed (+2235 additions, -317 deletions)

View changed files

📝 Dockerfile (+7 -0)
📝 packages/client/src/components/game/GameSurface.tsx (+36 -0)
📝 packages/client/src/components/modals/ModelDownloadModal.tsx (+276 -45)
📝 packages/client/src/components/panels/ConnectionsPanel.tsx (+79 -7)
📝 packages/client/src/stores/sidecar.store.ts (+156 -4)
📝 packages/server/src/app.ts (+1 -1)
📝 packages/server/src/routes/sidecar.routes.ts (+45 -4)
➕ packages/server/src/services/sidecar/mlx-runtime.service.ts (+358 -0)
📝 packages/server/src/services/sidecar/sidecar-inference.service.ts (+164 -24)
📝 packages/server/src/services/sidecar/sidecar-model.service.ts (+299 -32)
📝 packages/server/src/services/sidecar/sidecar-process.service.ts (+349 -110)
📝 packages/server/src/services/sidecar/sidecar-runtime.service.ts (+383 -84)
📝 packages/shared/src/types/sidecar.ts (+82 -6)

📄 Description

Summary

This PR hardens Marinara's local sidecar runtime so startup failures no longer softlock the app, while also improving runtime selection, recovery, and diagnostics.

  • keeps the app usable when the local sidecar fails to boot
  • stops /sidecar/status polling from repeatedly retrying the same known-bad startup config
  • preserves the Windows -sm none llama-server startup arg
  • adds smarter runtime detection and fallback logic for bundled llama.cpp runtimes
  • adds a one-click local runtime reinstall flow
  • adds diagnostics for runtime selection, detected GPU vendors, system llama-server, and the last launch command
  • restores the missing sidecar model/runtime plumbing needed by the newer reliability work
  • keeps the Apple Silicon MLX path working alongside the bundled llama.cpp path

User-Facing Changes

  • local sidecar failures now surface as contained UI errors instead of breaking game flow
  • the Local AI Model modal now offers:
    • Retry Startup
    • Reinstall Runtime
    • Continue Without Local AI
  • the game surface shows a non-blocking warning banner when the local scene helper fails
  • the connections panel now shows a clear local-runtime-unavailable state

Runtime Selection / Recovery

  • Windows runtime selection is more conservative and vendor-aware
  • Vulkan is no longer assumed to be usable just because a loader DLL exists
  • bundled llama.cpp startup still retries GPU offload more safely, but now also records the failed runtime variant and startup error
  • added an optional power-user override to use a system llama-server from PATH:
    • MARINARA_SIDECAR_USE_SYSTEM_LLAMA=1
    • MARINARA_SIDECAR_USE_SYSTEM_LLAMA_SERVER=1

Verification

  • pnpm check

Notes

  • this PR does not include docs/superpowers/
  • live runtime behavior on real failing Windows GPU machines and real Apple Silicon hardware was not tested in this environment
  • verification here is based on full workspace lint/build coverage plus integration wiring

🔄 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/122 **Author:** [@ghost](https://github.com/ghost) **Created:** 4/19/2026 **Status:** ✅ Merged **Merged:** 4/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `fix/sidecar-runtime-recovery` --- ### 📝 Commits (4) - [`b6b5355`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b6b53556ec44a3e4bd05cec531eb0f0c1eb03347) Harden sidecar runtime startup and recovery - [`33608d1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/33608d181003220a926b84f59b93e00595ffe2ca) Merge origin/main into fix/sidecar-runtime-recovery - [`fb13b2d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fb13b2df4406718e5d7426da7cf3378e9ecd2b27) Improve sidecar diagnostics and local test message - [`7f676b4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7f676b4babe72fe95b944063b1f3fefcfa99ddbb) Fix sidecar Docker runtime startup ### 📊 Changes **13 files changed** (+2235 additions, -317 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+7 -0) 📝 `packages/client/src/components/game/GameSurface.tsx` (+36 -0) 📝 `packages/client/src/components/modals/ModelDownloadModal.tsx` (+276 -45) 📝 `packages/client/src/components/panels/ConnectionsPanel.tsx` (+79 -7) 📝 `packages/client/src/stores/sidecar.store.ts` (+156 -4) 📝 `packages/server/src/app.ts` (+1 -1) 📝 `packages/server/src/routes/sidecar.routes.ts` (+45 -4) ➕ `packages/server/src/services/sidecar/mlx-runtime.service.ts` (+358 -0) 📝 `packages/server/src/services/sidecar/sidecar-inference.service.ts` (+164 -24) 📝 `packages/server/src/services/sidecar/sidecar-model.service.ts` (+299 -32) 📝 `packages/server/src/services/sidecar/sidecar-process.service.ts` (+349 -110) 📝 `packages/server/src/services/sidecar/sidecar-runtime.service.ts` (+383 -84) 📝 `packages/shared/src/types/sidecar.ts` (+82 -6) </details> ### 📄 Description ## Summary This PR hardens Marinara's local sidecar runtime so startup failures no longer softlock the app, while also improving runtime selection, recovery, and diagnostics. - keeps the app usable when the local sidecar fails to boot - stops `/sidecar/status` polling from repeatedly retrying the same known-bad startup config - preserves the Windows `-sm none` llama-server startup arg - adds smarter runtime detection and fallback logic for bundled llama.cpp runtimes - adds a one-click local runtime reinstall flow - adds diagnostics for runtime selection, detected GPU vendors, system `llama-server`, and the last launch command - restores the missing sidecar model/runtime plumbing needed by the newer reliability work - keeps the Apple Silicon MLX path working alongside the bundled llama.cpp path ## User-Facing Changes - local sidecar failures now surface as contained UI errors instead of breaking game flow - the Local AI Model modal now offers: - `Retry Startup` - `Reinstall Runtime` - `Continue Without Local AI` - the game surface shows a non-blocking warning banner when the local scene helper fails - the connections panel now shows a clear local-runtime-unavailable state ## Runtime Selection / Recovery - Windows runtime selection is more conservative and vendor-aware - Vulkan is no longer assumed to be usable just because a loader DLL exists - bundled llama.cpp startup still retries GPU offload more safely, but now also records the failed runtime variant and startup error - added an optional power-user override to use a system `llama-server` from `PATH`: - `MARINARA_SIDECAR_USE_SYSTEM_LLAMA=1` - `MARINARA_SIDECAR_USE_SYSTEM_LLAMA_SERVER=1` ## Verification - `pnpm check` ## Notes - this PR does not include `docs/superpowers/` - live runtime behavior on real failing Windows GPU machines and real Apple Silicon hardware was not tested in this environment - verification here is based on full workspace lint/build coverage plus integration wiring --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:07:56 +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#4474
No description provided.