fix(wfctl): plugin CLI binary path uses dir name twice (matches ensurePluginBinary)#613
Merged
Merged
Conversation
…ePluginBinary)
Second pass on the dispatch binary-path bug. workflow#595 fixed the
"manifest.Name twice" failure by joining dirName + manifest.Name, but
that breaks for the actual install convention:
ensurePluginBinary(destDir, pluginName) RENAMES the largest
executable in destDir to match `pluginName` (the SHORT install
name, e.g. "payments"). So the binary post-install lives at
destDir/{shortName}/{shortName}, not destDir/{shortName}/{manifestName}.
Real-world impact (buymywishlist#264 retrigger):
error: plugin workflow-plugin-payments command payments:
fork/exec /home/runner/work/.../data/plugins/payments/workflow-plugin-payments:
no such file or directory
$ ls data/plugins/payments
-rwxr-xr-x payments ← actual binary post-rename
plugin.json
Fix: BuildCLIRegistry joins dirName twice for the binary path. The
manifest.Name still flows into PluginName for log/audit purposes (so
"plugin workflow-plugin-payments command payments: …" error messages
remain informative), but the executable lookup uses the install
convention.
Test fixture writeCLIPluginNamed updated to match: stub binary written
at dirName, not manifestName, modeling the post-rename state.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
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
Second pass on the dispatch binary-path bug. workflow#595 fixed the "manifest.Name twice" failure by joining `dirName + manifest.Name`, but that breaks for the actual install convention:
`ensurePluginBinary(destDir, pluginName)` RENAMES the largest executable in `destDir` to match the (short) plugin name. So the binary post-install lives at `destDir/{shortName}/{shortName}`, not `destDir/{shortName}/{manifestName}`.
Real-world impact
buymywishlist#264 retrigger:
```
error: plugin workflow-plugin-payments command payments:
fork/exec /home/runner/work/buymywishlist/buymywishlist/data/plugins/payments/workflow-plugin-payments:
no such file or directory
$ ls data/plugins/payments
-rwxr-xr-x payments ← actual binary post-rename
plugin.json
```
Fix
`BuildCLIRegistry` now joins `dirName` twice for the binary path. The `manifest.Name` still flows into `PluginName` for log/audit purposes (so error messages like `"plugin workflow-plugin-payments command payments: …"` remain informative), but the executable lookup uses the install convention.
Test fixture `writeCLIPluginNamed` updated to match: stub binary written at `dirName`, not `manifestName`, modeling the post-rename state.
Tests
`TestPluginCLIRegistry_DirVsManifestNameMismatch` rewrites — pins both sides:
`TestPluginCLIRegistry_EmptyManifestNameUsesDirName` already correct (dirName=anonymous, binary=anonymous).
Verification
🤖 Generated with Claude Code