fix(herdr): repair the plugin install and the agent working directory - #25
Merged
Conversation
build.sh baked its own build-time directory into the generated run.sh. A GitHub install runs build.sh inside Herdr's temporary checkout, then moves the plugin to its final home and deletes that directory, so run.sh pointed at nothing and every action died: error: Module not found ".../plugins/.tmp-install-<pid>-<ms>/checkout/.../src/main.ts" Every install through 'createos sandbox setup herdr' was broken this way. The failure was invisible, because Herdr never puts plugin output on screen, so it looked like the keybindings did nothing. run.sh now resolves its own directory. Only the bun and createos paths stay baked, because the move does not affect them. Check: build in one directory, move it, run run.sh from the new place.
The createos CLI parses flags with urfave/cli, which stops at the
first positional argument. Every flag written after the sandbox name
is discarded with no error.
launch() passed 'process start <box> --pty --cwd /workspace', so the
agent started in /root and could not see the uploaded worktree. That
is the whole point of the plugin. Confirmed with /proc/<pid>/cwd:
before: claude cwd=/root
after: claude cwd=/workspace
Three more calls carried the same order:
sync() --local/--remote/--mode/--exclude were dropped, so the
sync pane fell back to an interactive prompt
boxExec() --stream was dropped, so installs never streamed
rm --yes was dropped
Fixed CLI-side in createos-cli#81, but this order also works on
already-released CLI versions, so the plugin does not have to wait
for a release.
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.
Two blocking bugs found by driving the plugin interactively for the first time. Both were invisible, so they looked like dead keybindings.
1. Every GitHub install was broken
build.shbaked its build-time directory into the generatedrun.sh. A GitHub install runsbuild.shinside Herdr's temporary checkout, then moves the plugin to its final home and deletes that directory.Every action died with
error: Module not found. Recovered fromherdr plugin log list:run.shnow resolves its own directory. Only thebunandcreateospaths stay baked, since the move does not affect them.Check: build in one directory, move it, run
run.shfrom the new place. Before the fix it printedModule not found.2. The agent never landed in the uploaded repository
The
createosCLI parses flags withurfave/cli, which stops at the first positional argument. Every flag after the sandbox name is discarded with no error.launch()passedprocess start <box> --pty --cwd /workspace, so--cwdwas dropped and the agent started in/root. It could not see the worktree the plugin had just uploaded — which is the entire point of the plugin.Confirmed with
/proc/<pid>/cwdinside the sandbox:Three more calls carried the same order:
sync()--local,--remote,--mode,--exclude,--yesboxExec()--streamsandbox rm--yesFixed CLI-side in NodeOps-app/createos-cli#81, but this ordering also works on already-released CLI versions, so the plugin does not have to wait for a release.
Interactive test behind these findings
Real keystrokes through Herdr 0.8.2, not scripted CLI calls. All five supported agents were installed, attached, and reached a live PTY, each stopping at its own login screen:
claude-codecodexopencode/connectpromptpi/loginpromptcursorPressing Enter on Claude Code's theme picker advanced the screen, which proves input reaches the agent. A
.envtracked by Git was correctly kept out of the upload.Full report, including the findings not fixed here:
docs/herdr-plugin-interactive-test-2026-08-26.md.Known, not fixed here
herdr plugin log listhas them — but shows nothing in the UI. This is what hid both bugs above.delete's "invoke twice to confirm" gives no prompt, andinfoshows nothing at all. The plugin never callsherdr notification show, which exists and works.deleteleaves the pane open, still labelled with the destroyed sandbox.dshis not a supported agent, although this repo shipspackages/dsh-createos.Checks
bun test(4 pass),oxlint(0 warnings, 0 errors),oxfmt --check(clean), plus the live end-to-end run above.