Skip to content

Fix hook commands breaking on Homebrew/uv upgrades#21

Merged
nicksenap merged 4 commits intomasterfrom
fix/stable-hook-path
Mar 11, 2026
Merged

Fix hook commands breaking on Homebrew/uv upgrades#21
nicksenap merged 4 commits intomasterfrom
fix/stable-hook-path

Conversation

@nicksenap
Copy link
Owner

Summary

  • Hook commands used sys.executable (versioned Python path like Cellar/grove/0.12.0/...) which broke after Homebrew/uv upgrades
  • Now uses the stable gw entry point via shutil.which("gw"), which resolves to the Homebrew symlink that survives version changes
  • Added hidden gw _hook --event X CLI command as the new hook entry point
  • Auto-migrates old hooks when user runs gw dash install (detects both old grove.dash and new gw _hook formats)

Test plan

  • All 328 tests pass
  • gw dash install on fresh install writes gw _hook commands
  • gw dash install on existing install replaces old python-path hooks
  • gw dash uninstall removes both old and new format hooks
  • Hooks survive brew upgrade grove

🤖 Generated with Claude Code

nicksenap and others added 4 commits March 11, 2026 13:53
Use stable `gw` entry point instead of versioned Python interpreter
path in Claude Code hooks. The old approach hardcoded sys.executable
(e.g. Cellar/grove/0.12.0/...) which broke when upgrading versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix fallback module path from grove.cli to grove.dash (has __main__.py)
- Move shutil import to module level in cli.py
- Extract "gw _hook" magic string to _GROVE_HOOK_CMD constant

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Users will uninstall+reinstall hooks when upgrading, so no need
to detect the old python-path format. Single _GROVE_MARKER is enough.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Without this, `gw dash uninstall` after upgrading would leave
orphaned old hooks (grove.dash format) in settings.json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nicksenap nicksenap merged commit 7a9498d into master Mar 11, 2026
2 checks passed
@nicksenap nicksenap deleted the fix/stable-hook-path branch March 11, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant