Skip to content

Plugin: ensure-venv fails SessionStart on Python < 3.11 even when the plugin venv will not be used #140

Description

@bgausden

Problem

The SessionStart hook runs ensure-venv.sh / ensure-venv.bat unconditionally, and both start with a Python ≥ 3.11 guard (sh L28–35, bat L32–39) that exits 1.

Since 8e914e4, slm-launch under the default SLM_LAUNCHER=auto uses an installed slm and never touches the plugin venv. On a host where SLM is installed in its own environment but the first python3 on PATH is older (e.g. macOS system Python 3.9), every session start reports a Python-version error for a venv that is never used.

Proposed change

Before the guard, exit 0 when the launcher will not use the plugin venv, using the same decision as slm-launch:

SLM_LAUNCHER Bootstrap?
plugin yes
auto / unset, slm on PATH skip
auto / unset, no slm on PATH yes
system or a path skip

A skip must not be based on "a daemon is running": under auto with no PATH slm, the launcher still execs the plugin venv even when a daemon is up.

The POSIX half is implemented and tested on a fork (commit in barrygfox/superlocalmemory, happy to open a PR). The Windows half depends on the Windows launcher issue (#139), because today slm-launch.bat always uses the venv and any skip would leave it without slm.exe.

Acceptance criteria

  • ensure-venv.sh with SLM_LAUNCHER unset, a fake slm on PATH and a python3 < 3.11 first on PATH exits 0 and creates no $CLAUDE_PLUGIN_DATA/venv.
  • ensure-venv.sh with SLM_LAUNCHER=system or SLM_LAUNCHER=/some/path exits 0 and creates no venv.
  • ensure-venv.sh with SLM_LAUNCHER=plugin and python3 < 3.11 still exits 1 with the existing error (existing test test_rejects_python_less_than_3_11 passes).
  • Same three cases hold for ensure-venv.bat (structural tests in test_wf_windows_crossplatform.py), landed only after Plugin (Windows): slm-launch.bat always runs the plugin venv — add SLM_LAUNCHER selection to match POSIX #139.
  • plugin/ and copilot-plugin/ copies are regenerated; build-plugin.mjs --check and build-copilot-plugin.mjs --check pass.

Dependencies


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