fix: support python fallback in continuous-learning observe hook#350
fix: support python fallback in continuous-learning observe hook#350tsubasakong wants to merge 3 commits intoaffaan-m:mainfrom
Conversation
📝 WalkthroughWalkthroughAdds a SCRIPT_DIR-based fallback for plugin root resolution and makes observe.sh detect and use an available Python binary ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
No issues found across 2 files
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@skills/continuous-learning-v2/hooks/observe.sh`:
- Around line 15-23: The early-exit branch that runs when no Python is found
should first drain stdin to avoid leaving the upstream printf writer hanging; in
the no-Python else branch (the block that echoes "[observe] No python found,
skipping observation" and exits), consume/redirect stdin (e.g. by piping/reading
to /dev/null or using cat >/dev/null) before calling exit so the caller's writer
doesn't receive SIGPIPE and fail the pipeline.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f93907fe-e5e4-409a-8446-bb7ec5d98697
📒 Files selected for processing (2)
scripts/hooks/run-with-flags-shell.shskills/continuous-learning-v2/hooks/observe.sh
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
…back-observe-hook
Summary
skills/continuous-learning-v2/hooks/observe.sh(python3preferred,pythonfallback)python3invocations with the resolved command to support Windows Git Bash environmentsCLAUDE_PLUGIN_ROOTfallback inscripts/hooks/run-with-flags-shell.shbased on script location when the env var is unsetValidation
bash -n skills/continuous-learning-v2/hooks/observe.shbash -n scripts/hooks/run-with-flags-shell.shCloses #349
Summary by cubic
Make the continuous-learning observe hook portable by resolving the Python executable at runtime and defaulting
CLAUDE_PLUGIN_ROOTfrom the script location. Fixes failures on Windows (Git Bash) and when the env var is unset, addressing #349.python3first, fallback topython, and use it for all inline JSON parsing.CLAUDE_PLUGIN_ROOTinscripts/hooks/run-with-flags-shell.shbased on the script path.Written for commit 30abf36. Summary will update on new commits.
Summary by CodeRabbit