fix: Windows plugin system — hook execution, stale state, binary resolution#373
fix: Windows plugin system — hook execution, stale state, binary resolution#373
Conversation
…lution Fix three compounding bugs that made plugins completely unusable on Windows: 1. **Hook execution (OS error 193)**: Shell script hooks now try sh/bash/git-bash on Windows instead of failing with "not a valid Win32 application". Bat/cmd hooks are executed via `cmd /c`, and .exe hooks run directly. 2. **Stale install state**: post_install hook now runs BEFORE persisting to the registry. On hook failure, symlinks and plugin directory are cleaned up so reinstall isn't blocked by "already installed". Build failures also roll back the plugin directory. 3. **Binary resolution**: resolve_plugin_command() and which_fledge_plugin() now check .exe/.bat/.cmd extensions on Windows when looking up plugin binaries in the bin directory and PATH. Fixes #372 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
❌ Corvin says...
_
<(;\ .oO(oh no...)
|/(\
\(\\
" "\\
"Caw... validation failed..."
CI Summary
| Check | Status |
|---|---|
| Dependency Audit | ✅ Passed |
| Lint (fmt + clippy) | ❌ failure |
| Spec Validation | ✅ Passed |
| Tests (3 OS) | ✅ Passed |
Powered by corvid-pet
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
👋 CorvidAgent is looking into this. |
`hook_path` is already `&Path`, so `&hook_path` creates a double reference. Clippy correctly flags this as `clippy::needless_borrow`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Fixed in 6bc1386. The previous commit addressed Waiting on CI to confirm green. |
There was a problem hiding this comment.
❌ Corvin says...
_
<(;\ .oO(oh no...)
|/(\
\(\\
" "\\
"I'm pecking through the errors..."
CI Summary
| Check | Status |
|---|---|
| Dependency Audit | ✅ Passed |
| Lint (fmt + clippy) | ❌ failure |
| Spec Validation | ✅ Passed |
| Tests (3 OS) | ✅ Passed |
Powered by corvid-pet
|
👋 CorvidAgent is looking into this. |
There was a problem hiding this comment.
✅ Corvin says...
_
<(^\ .oO(Caw! ^v^)
|/(\
\(\\
" "\\
"Looking sharp! Like a beak should be."
CI Summary
| Check | Status |
|---|---|
| Dependency Audit | ✅ Passed |
| Lint (fmt + clippy) | ✅ Passed |
| Spec Validation | ✅ Passed |
| Tests (3 OS) | ✅ Passed |
Powered by corvid-pet
|
CI is all green now — lint, tests (all 3 OS), audit, and spec-check all passing. The two fix commits ( |
|
👋 CorvidAgent is looking into this. |
2 similar comments
|
👋 CorvidAgent is looking into this. |
|
👋 CorvidAgent is looking into this. |
Hook execution now uses run_hook_file (introduced in #373), which handles .bat/.cmd via cmd /c, .exe directly, and shell scripts via sh/bash on Windows. Plugin binary lookup uses the cfg!(windows) runtime check from main with .exe/.bat/.cmd extensions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Fixes three compounding bugs that made plugins completely unusable on Windows (#372):
.sh/extensionless) now trysh,bash, and git-bash on Windows instead of failing with OS error 193..bat/.cmdhooks execute viacmd /c,.exehooks run directly.post_installhook now runs before persisting to the plugin registry. On hook/build failure, symlinks and the plugin directory are cleaned up so reinstall isn't blocked by "already installed".resolve_plugin_command()andwhich_fledge_plugin()now check.exe,.bat,.cmdextensions on Windows when resolving plugin binaries.Files Changed
src/plugin/run_plugin.rs— Newrun_hook_file()helper for platform-aware hook execution; Windows extension search inwhich_fledge_plugin()src/plugin/mod.rs— Windows extension search inresolve_plugin_command()src/plugin/install.rs— Movedpost_installbeforesave_registry()with rollback; added rollback forrun_build()failuresTest Plan
cargo checkpassesmain, unrelated)fledge-plugin-bridge(needs Windows CI or @Kyntrin to verify)Fixes #372
🤖 Generated with Claude Code