Skip to content

Fix quick-actions failing to spawn outside the plugin's install dir#23

Merged
cloudmanic merged 1 commit into
mainfrom
fix-quickactions-cwd
Jun 16, 2026
Merged

Fix quick-actions failing to spawn outside the plugin's install dir#23
cloudmanic merged 1 commit into
mainfrom
fix-quickactions-cwd

Conversation

@cloudmanic

Copy link
Copy Markdown
Owner

The bug

Quick Actions (prefix+down) failed to open from any directory except the plugin's own install dir, while Projects (prefix+up) always worked. The herdr server log showed it every time:

ERROR herdr::pane: failed to spawn ... Unable to spawn
  /Users/spicer/.dotfiles/./bin/herdr-plus because it does not exist
  method="plugin.pane.open"

Root cause

The manifest registers the picker panes with a relative command, ["./bin/herdr-plus", …], which herdr resolves against the pane's working directory.

  • projects opens its pane with no --cwd → the pane runs in the plugin's dir → ./bin/herdr-plus resolves. ✅
  • quick-actions opened its overlay with --cwd <launch dir> (quickactions.go) → herdr resolved ./bin/herdr-plus against e.g. ~/.dotfiles → spawn fails. ❌

Fix

Remove the --cwd block from launchQuickActions(). It was purely cosmetic — the launch directory still reaches the picker and every action it runs through HERDR_PLUS_CTXctx.WorkDir, which sets:

  • each command's cmd.Dir (action.go:178-179), and
  • the per-repo .herdr-plus/quick-actions/ lookup (quickactionspicker.go:389).

So actions still run in your launch directory; only the (unused) pane cwd changes, letting the relative binary path resolve exactly like projects. Added a comment so it doesn't get reintroduced.

Verified

  • go build / go vet / go test ./... all green.
  • No test asserted --cwd.

Diagnosed from a herdr server log on a machine where the plugin was installed outside its source tree (credit to the diagnosis Spicer relayed).

The quick-actions overlay pane is registered in the manifest with a relative
command (./bin/herdr-plus), which herdr resolves against the pane's working
directory. launchQuickActions passed --cwd <launch dir> when opening the pane, so
herdr looked for ./bin/herdr-plus inside the launch directory (e.g. ~/.dotfiles)
and failed to spawn the picker:

  ERROR herdr::pane: failed to spawn ... Unable to spawn
  /Users/.../.dotfiles/./bin/herdr-plus because it does not exist

It only worked when launched from the plugin's own install dir. The projects pane
never set --cwd, which is why projects (prefix+up) always worked while
quick-actions (prefix+down) failed everywhere else.

Drop the --cwd block so quick-actions resolves the binary the same way projects
does. The flag was purely cosmetic: the launch directory still reaches the picker
and every action through HERDR_PLUS_CTX (ctx.WorkDir), which sets each command's
cmd.Dir (action.go) and the per-repo action lookup (quickactionspicker.go). Added
a comment so it isn't reintroduced.
@cloudmanic cloudmanic merged commit a855335 into main Jun 16, 2026
2 checks passed
@cloudmanic cloudmanic deleted the fix-quickactions-cwd branch June 16, 2026 06:21
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