Skip to content

Plugin (Windows): slm-launch.bat always runs the plugin venv — add SLM_LAUNCHER selection to match POSIX #139

Description

@bgausden

Problem

On macOS/Linux, slm-launch picks which slm binary runs the MCP server (SLM_LAUNCHER: auto by default, system, plugin, or a path), and under auto it prefers an slm already installed on PATH (8e914e4, "the plugin uses the SuperLocalMemory you already have").

The Windows launcher has no selection. plugin-src/scripts/slm-launch.bat always runs %CLAUDE_PLUGIN_DATA%\venv\Scripts\slm.exe, so on a Windows host that already has SLM installed (pip/pipx/npm, possibly running as a logon task via slm serve install):

  • the plugin still needs its own venv, and so still needs Python ≥ 3.11 on PATH at SessionStart;
  • the MCP server runs the plugin's copy of slm, which can be a different version from the daemon serving the same store — this is what the POSIX auto path warns about already.

slm serve start is already idempotent against a running daemon (commands.py), so a second daemon is not started today; the issue is which binary the launcher runs.

Proposed change

Port the POSIX selection from slm-launch L59–131 to slm-launch.bat, using where slm for PATH lookup. Leave "is a daemon already running?" to slm serve start rather than re-implementing liveness in batch. Mirror the change to plugin/scripts/slm-launch.bat.

Acceptance criteria

  • With SLM_LAUNCHER unset and slm on PATH, slm-launch.bat runs slm serve start then slm mcp using the PATH binary, and never references venv\Scripts\slm.exe.
  • With SLM_LAUNCHER unset and no slm on PATH, it runs %CLAUDE_PLUGIN_DATA%\venv\Scripts\slm.exe (today's behaviour).
  • SLM_LAUNCHER=system with no slm on PATH exits non-zero with a message naming SLM_LAUNCHER=system.
  • SLM_LAUNCHER=plugin with CLAUDE_PLUGIN_DATA unset exits non-zero with a message naming CLAUDE_PLUGIN_DATA.
  • SLM_LAUNCHER=<path> runs that binary; a non-existent path exits non-zero naming the path.
  • Under auto, when both a PATH slm and a plugin venv exist with different versions, a warning naming both versions is written to stderr (parity with POSIX).
  • plugin/scripts/slm-launch.bat is byte-identical to plugin-src/scripts/slm-launch.bat.
  • tests/test_plugin/test_wf_windows_crossplatform.py asserts the .bat handles SLM_LAUNCHER values auto, system, plugin and a path (structural, like the existing tests there).

Out of scope


This issue was generated by an AI assistant (Claude) from a read of the code at 5bfa47c, and reviewed by a human before posting.

Activity

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