Skip to content

fix: LM Studio cold spawn — launcher's clean exit is startup, not death - #174

Open
nixfred wants to merge 1 commit into
dbbaskette:mainfrom
nixfred:fix/lms-launcher-cold-spawn
Open

fix: LM Studio cold spawn — launcher's clean exit is startup, not death#174
nixfred wants to merge 1 commit into
dbbaskette:mainfrom
nixfred:fix/lms-launcher-cold-spawn

Conversation

@nixfred

@nixfred nixfred commented Aug 4, 2026

Copy link
Copy Markdown

First real-world cold spawn of the managed LM Studio provider (first summarize after a reboot) fails every time with lm-studio: process exited before becoming healthy.

Root cause: lms server start is a launcher — it daemonizes the actual server and exits 0 about 1.5s in. ManagedService assumes daemon-style children (ollama serve, whisper-server stay alive), so the clean exit during startup reads as death. The kicker from the live log: one second after the failure, the next ensureReady() adopts the very server the launcher just started (reusing existing instance), which is why Retry always works and the bug stays hidden.

Success! Server is now running on port 1234
lm-studio: exited code=0 signal=null uptime=1523ms
pipeline:failure ... process exited before becoming healthy
(+1s) lm-studio: reusing existing instance at 127.0.0.1:1234

Fix: launcherExitsOk flag on ManagedServiceDeps — a code-0 exit during startup keeps polling health for the daemonized server; non-zero exits still fail fast. Only the lm-studio service sets it; whisper/ollama/sidecar behavior unchanged.

Testing: new regression test (launcher exits 0 immediately, health goes green on the 3rd poll, ensureReady resolves); verified live — stopped the LM Studio server, ran a summarize, the app cold-started it and completed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Fx2epy4XwaBS3S8Y5J7FX9

…p, not death

'lms server start' daemonizes the real server and exits 0 (~1.5s in),
unlike ollama serve / whisper-server which stay alive. ManagedService
read any child exit during startup as fatal, so the FIRST summarize
after a reboot always failed with 'lm-studio: process exited before
becoming healthy' — while the server it had just launched came up fine
a second later (the next ensureReady adopts it, which is why the retry
button always worked and the bug hid).

Fix: new launcherExitsOk flag on ManagedServiceDeps — a code-0 exit
during startup keeps health-polling; non-zero exits still fail fast.
Only the lm-studio service sets it.

Log evidence from a real cold start:
  'Success! Server is now running on port 1234'
  'lm-studio: exited code=0 signal=null uptime=1523ms'
  'pipeline:failure ... process exited before becoming healthy'
  +1s: 'lm-studio: reusing existing instance at 127.0.0.1:1234'

Test: regression covering launcher-exit-then-healthy; llm suite green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fx2epy4XwaBS3S8Y5J7FX9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant