Repository navigation
fix: auto-start never reloads a service that slm serve uninstall is removing - #346
Merged
Merged
Conversation
…emoving slm serve install and uninstall take the service-mutation lock; the auto-start added in 4.2.32 did not. Between uninstall's unload and its removal of the definition file, an MCP client could auto-start the daemon and launchctl bootstrap the file again, leaving a loaded job with no definition on disk. A reinstall had the same window with the old file. request_start now holds the same lock while it asks launchd, systemd or Task Scheduler. It never waits for it: while an installer holds the lock it answers busy and the daemon is started directly with the service's settings. Refs #337 Co-Authored-By: Claude Opus 5.5 <[email protected]>
2 of 3 tasks
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.
What was wrong
slm serve install/uninstalltake the service-mutation lock (infra/service_mutation); the auto-start paths added in #332 did not. Between uninstall's unload and its removal of the definition, an MCP client's auto-start couldlaunchctl bootstrapthe file again: uninstall then reported success with a job loaded and no definition on disk (#337).What changes
daemon_supervisor.request_starttakes the same lock (non-blocking) around the service-manager calls on macOS, Linux and Windows. While an installer holds it, the outcome isbusyand the caller starts the daemon directly with the service's settings (existing fallback). It never waits on an installer.Test plan
Refs #337
🤖 Generated with Claude Code