Desktop: Quit after an unfinished local-model setup leaves the engine and gateway running, and an upgrade then reports gateway-port-in-use

Aperta
#619 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@oldwinter53 ci sta già lavorando.

Dal 25/11/2026.

  • #703 di @oldwinter53 — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
electron, typescript
Ambito
cli, desktop

Direzione di ricerca

Start in apps/desktop/src/main/local-server.ts: LocalServer.stop("quit") only runs --stop-local-models when desktop/local-server.json exists, and that file is written only after a successful Quick Install (around line 1319). Reproduce by quitting during an unfinished setup and checking whether llama-server and bifrost-http keep running. Done means Quit stops both whenever this install started them, and the 0.1.8 kit's stop path also finds the gateway under state/gateway/bifrost.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

What happens

Quitting Linger Desktop after a local-model Quick Install that did not finish leaves the model engine (llama-server, holding 26.5 GB of VRAM here) and the local Bifrost gateway running with no Linger process left. After an upgrade, the new version's setup check then refuses local models with gateway-port-in-use, and the new version's --stop-local-models does not stop the gateway the earlier version started.

Repro (Linux x64, NVIDIA RTX PRO 6000 shared with another workload)

  1. Fresh home. Start Linger 0.1.6 (Linger-0.1.6-linux-x64.tar.gz), Quick Install with the recommended local model (qwen3.8-27b).
  2. The install downloads the model and starts the engine, then stops at "The upstream tool could not verify the local stack binding: Not every deployment in the plan is ready yet ..." (another process was using GPU 0 at the same time, so the free-memory budget moved). Setup shows the failure. Try Again reapplies the plan, starts the engine again and stops the same way, then waits at "Review the upstream local model plan before installing."
  3. While setup is in that state, quit Linger (SIGTERM, which takes the same before-quit path as tray Quit).
  4. llama-server (pid 1623854, 26.5 GB on GPU 0), its slot_cache.py parent and bifrost-http (listening on 127.0.0.1:47711) keep running. <home>/installer/local-models-stop.log is never written and the Desktop log has no local_server.local_models_stopping.
  5. Replace the app folder with 0.1.8-rc.0 and start it. The setup check reports {"eligible":false,"blockedNow":true,"reasons":[{"code":"gateway-port-in-use"}],"recommendation":"pi"}, so Quick Install now offers Pi instead of the local model.
  6. Run 0.1.8-rc.0's own installer.js --home <home> --stop-local-models: it unloads the model and stops llama-server ({"failed":[]}), but the 0.1.6 gateway (<HOME>/.local/share/localmodels/tools/bifrost-v2.3.0-localmodels.6/bifrost-http -app-dir <home>/runtime/localmodels/state/gateway/bifrost -port 47711) keeps running and the setup check still says gateway-port-in-use.
  7. Killing that one bifrost-http process clears it: the next check is eligible: true with recommendation: local-models.

Why

LocalServer.stop("quit") only starts --stop-local-models when desktop/local-server.json exists (apps/desktop/src/main/local-server.ts:618), and that record is written only after a Quick Install succeeds (local-server.ts:1319). A failed or unfinished attempt has started the engine and the gateway, but nothing stops them at Quit.

Step 6 suggests the 0.1.8 kit's stack down only knows the gateway in its own layout (<home>/runtime/localmodels/bifrost), not the one an earlier kit started under state/gateway/bifrost with its binary in the user-wide ~/.local/share/localmodels/tools.

Expected

  • Quit stops the engine and gateway whenever this installation started them, finished or not.
  • An upgraded kit stops, or adopts, the gateway an earlier kit started in the same home, and a leftover gateway from this home does not block the setup check.

Not checked yet

The in-app update path also leaves local models running on purpose (StopReason "update"). Upgrading a finished 0.1.6 local-model install through the updater may hit the same leftover-gateway problem; the U1 case in .agents/skills/verify-linger/features/local-models-and-byok.md#sleep-wake-and-quit covers it.

Process lists, ports, GPU usage and the setup check JSON were captured at each step and are available on request.

Lingua principale
TypeScript
Stelle
3.8k
Fork
360
Merge medio
8h 10m
PR unite (30g)
540

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di simplexai-labs/linger

Tutte le issue di simplexai-labs/linger

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.