Skip to content

[Feature] Studio: optional launchd agent to keep Studio running on macOS CLI installs #17877

Closed

Description

@Tofuwang45

Problem

On macOS, Studio installed from the terminal (install.sh) stops when the terminal window closes, so its scheduled tasks stop running too. Linux already has an opt-in systemd user service (#9308), and the desktop app has "Run at login", but macOS terminal installs have no way to keep Studio running in the background.

Proposal

An opt-in launchd user agent for macOS that matches the Linux systemd service:

  • UNSLOTH_INSTALL_LAUNCHD=1 ./install.sh writes ~/Library/LaunchAgents/ai.unsloth.studio.server.plist and loads it. Without the flag, nothing changes.
  • Binds 127.0.0.1:8888 by default; UNSLOTH_LAUNCHD_HOST / UNSLOTH_LAUNCHD_PORT override it (same as the UNSLOTH_SYSTEMD_* variables).
  • Restarts Studio only after a crash (KeepAlive → SuccessfulExit = false), so unsloth studio stop leaves it stopped.
  • Skipped when the desktop app's "Run at login" agent exists, so two servers don't fight over the port.
  • Never overwrites a plist it didn't write.
  • scripts/uninstall.sh unloads and removes it before stopping servers.
  • Output goes to /dev/null, because Studio already writes its own private, rotated logs under logs/server/.

Out of scope

Windows Task Scheduler and the scheduled-tasks UI redesign from the ideas list.

I have this working and tested on a Mac (unit tests, plus a real install with kill -9, studio stop, restart and uninstall), and will open a PR that links this issue.

Activity

  1. added a commit that references this issue on Nov 16, 2026
    f8f3717
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions