fix: LM Studio cold spawn — launcher's clean exit is startup, not death - #174
Open
nixfred wants to merge 1 commit into
Open
fix: LM Studio cold spawn — launcher's clean exit is startup, not death#174nixfred wants to merge 1 commit into
nixfred wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 startis a launcher — it daemonizes the actual server and exits 0 about 1.5s in.ManagedServiceassumes daemon-style children (ollama serve,whisper-serverstay alive), so the clean exit during startup reads as death. The kicker from the live log: one second after the failure, the nextensureReady()adopts the very server the launcher just started (reusing existing instance), which is why Retry always works and the bug stays hidden.Fix:
launcherExitsOkflag onManagedServiceDeps— 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,
ensureReadyresolves); 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