Skip to content

fix: auto-start never reloads a service that slm serve uninstall is removing - #346

Merged
varun369 merged 1 commit into
mainfrom
fix/autostart-service-lock
Nov 20, 2026
Merged

varun369 merged 1 commit into
mainfrom
fix/autostart-service-lock

Conversation

@varun369

Copy link
Copy Markdown
Member

What was wrong

slm serve install/uninstall take 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 could launchctl bootstrap the file again: uninstall then reported success with a job loaded and no definition on disk (#337).

What changes

daemon_supervisor.request_start takes the same lock (non-blocking) around the service-manager calls on macOS, Linux and Windows. While an installer holds it, the outcome is busy and the caller starts the daemon directly with the service's settings (existing fallback). It never waits on an installer.

Test plan

  • New: a held lock makes auto-start skip the manager entirely (no launchctl call); the lock is held during the manager call and released after (red before, green after)
  • tests/test_cli supervisor/service/daemon/launchd/handover: 585 passed, 1 skipped
  • Full suite on GitHub before release

Refs #337

🤖 Generated with Claude Code

…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]>
@varun369
varun369 merged commit a1f647b into main Nov 20, 2026
7 checks passed
@varun369
varun369 deleted the fix/autostart-service-lock branch November 20, 2026 20:51
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