fix(plugin): fall back to pip/uv-installed skillopt-sleep in run-sleep.sh#107
Open
ichoosetoaccept wants to merge 1 commit into
Open
fix(plugin): fall back to pip/uv-installed skillopt-sleep in run-sleep.sh#107ichoosetoaccept wants to merge 1 commit into
ichoosetoaccept wants to merge 1 commit into
Conversation
…p.sh
The Claude Code and Codex plugin shells' runner (run-sleep.sh) only
resolved the engine by searching for a skillopt_sleep/ source directory
on disk. After v0.2.0 shipped the engine on PyPI (skillopt-sleep CLI),
the plugins still errored for users who installed via pip/uv without
cloning the repo — even though the error message said "pip install
skillopt" would work.
Add two fallbacks before the error:
1. skillopt-sleep CLI on PATH (covers uv tool install, pipx, pip install)
2. python -m skillopt_sleep when importable (covers pip install into
the active Python)
Fallback 1 is checked before fallback 2 because uv tool install / pipx
isolate the package from the system Python's import path, so the import
check would fail even though the CLI is available.
The existing source-checkout resolution path is unchanged — repo-clone
users keep working as before. The fix lands in both plugins/run-sleep.sh
(shared, used by Codex) and plugins/claude-code/scripts/run-sleep.sh
(bundled copy, byte-identical, used by the Claude Code marketplace
install which fetches only the plugins/claude-code/ subtree).
Contributor
|
@ichoosetoaccept please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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.
Summary
The Claude Code and Codex plugin shells' runner (
run-sleep.sh) only resolved the engine by searching for askillopt_sleep/source directory on disk. After v0.2.0 shipped the engine on PyPI (skillopt-sleepCLI), the plugins still errored for users who installed via pip/uv without cloning the repo — even though the error message said "pip install skillopt" would work.This adds two fallbacks before the error:
skillopt-sleepCLI on PATH (coversuv tool install,pipx,pip install) — checked first because uv tool install / pipx isolate the package from the system Python's import path, so the import check would fail even though the CLI is available.python -m skillopt_sleepwhen importable (coverspip installinto the active Python)The existing source-checkout resolution path is unchanged — repo-clone users keep working as before. The fix lands in both
plugins/run-sleep.sh(shared, used by Codex) andplugins/claude-code/scripts/run-sleep.sh(bundled copy, byte-identical, used by the Claude Code marketplace install which fetches only theplugins/claude-code/subtree).After this fix, the install path is:
uv tool install skillopt(orpip install skillopt) — self-updating engine/plugin marketplace add+/plugin install— self-updating plugin shellSKILLOPT_SLEEP_REPO, no manualgit pull.Closes #106.
Test plan
tests/test_run_sleep_fallback.py— 6 new tests covering source-checkout path, CLI fallback (both shared and bundled copies), arg passthrough, no-engine error message, and bundled/shared sync checkshellcheckpasses on both modified scriptsbash plugins/run-sleep.sh --helpfrom repo root worksuv tool install skillopt, then run from/tmpwith no source dir — engine runs viaskillopt-sleepon PATHpytest/openaioptional deps, unrelated to this change)