fix: SKILLOPT_SLEEP_PYTHON override + lookback_hours first-run fallback#74
Merged
Merged
Conversation
…llback Two fixes from issue microsoft#57 feedback: 1. run-sleep.sh: support SKILLOPT_SLEEP_PYTHON env var to explicitly set the Python interpreter. Useful on macOS where system Python is 3.9 but a newer Python is available elsewhere (e.g. Codex Desktop's bundled Python 3.12). Applied to both the shared runner and the bundled Claude Code plugin copy. 2. cycle.py: on first run (no prior harvest recorded), apply the lookback_hours config (default 72h) as a time cutoff. Previously, first run scanned the entire transcript history, which could trigger massive LLM mining on users with months of session data. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- cycle.py: use supplied `clock` parameter (not wall time) for the lookback cutoff, so deterministic tests/experiments get reproducible harvest windows - harvest.py: break (not continue) when a file is older than since_iso, since files are sorted newest-first by mtime — avoids scanning the entire transcript directory for quiet projects with large histories Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- harvest.py: revert break to continue — mtime ordering can diverge from embedded ended_at timestamps (copy/touch), so we must check all files rather than early-exiting on the first old one - cycle.py: use `is not None and > 0` so lookback_hours=0 means "scan full history" (opt-out of the cutoff) - __main__.py: propagate --lookback-hours 0 to config as explicit 0 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codex round 3: argparse default=0 made every CLI invocation without --lookback-hours clobber the config's 72h default. Now default=None; only explicit --lookback-hours N (including 0) overrides config. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Two fixes from issue #57 community feedback:
1.
SKILLOPT_SLEEP_PYTHONenv var (issue #57 point 4)macOS users with system Python 3.9 but a newer Python available elsewhere (e.g. Codex Desktop's bundled 3.12) had no way to tell the runner which Python to use.
Now:
export SKILLOPT_SLEEP_PYTHON=/path/to/python3.12overrides auto-detection. Applied to bothplugins/run-sleep.shand the bundled Claude Code plugin copy.2.
lookback_hoursfirst-run fallback (issue #57 point 10)Previously, the first run (no prior harvest recorded) scanned the entire transcript history — users with months of data triggered massive LLM mining. Now applies
lookback_hours(default 72h) as a time cutoff on first run.--lookback-hours 0explicitly opts out (full history scan). Omitting the flag preserves the config default (72h).Codex + GPT-5.5 review (4 rounds)
clockfor cutoff (not wall time)breakcontinue--lookback-hours 0clobbered by config defaultis not None and > 0NoneTest plan
SKILLOPT_SLEEP_PYTHON=/usr/bin/python3 bash plugins/run-sleep.sh statusworks--lookback-hours 0scans full historyclockparameter gets reproducible cutoff🤖 Generated with Claude Code