Repository navigation
Add agents - #15
Add agents#15
Conversation
geodro
left a comment
There was a problem hiding this comment.
Thanks for this, it reads cleanly and the README matches what the code does. I went through every file at e068573 and ran it in a throwaway Ubuntu 26.04 desktop VM on lerd 1.38.0 against a Laravel site. Nothing leaves the machine, it asks for no privilege, it writes only its hooks.log and herdr-workspaces.json in its data folder, and lerd's config and sites were unchanged afterwards. Hostile input (a branch named with quotes, $(...) and markup, ../ and /etc as the folder, bad JSON) was refused or escaped everywhere, the tab and card escape what they draw, and open stays loopback only and checks the folder against the site's own checkouts. Nice work on that part.
One thing has to change before it can be listed. On Linux, Orca's desktop app installs its CLI as orca-ide, because GNOME's Orca screen reader already owns the name orca, and Ubuntu and Fedora desktops ship that screen reader at /usr/bin/orca. The plugin looks up plain orca, so on those machines every status poll from the tab or card (every five seconds), every agents:watch tick, the Open in Orca command and the worktree.added hook run the screen reader instead. It reads its arguments with parse_known_args, so it ignores worktree ps --json, prints "The following are not valid", and starts up for real when it has a display, which lerd's dashboard service has on a desktop session. Under a virtual display I saw it register on the accessibility bus, probe the braille API, write ~/.local/share/orca and dconf, and stay running until the 8 second timeout killed it. Without a display it segfaults in about a second, which is the 1.2s you see on Open in Orca.
The fix I'd suggest: on Linux look for orca-ide first (and ORCA_BIN), never fall back to a bare orca there, and only treat a binary as Orca once it answers with Orca's {"ok": ...} JSON. The README and DOCS should name orca-ide on Linux and link Orca's repository the way they link herdr.
A smaller one: the worktree.added hook can make up to six tool calls with 5 to 15 second timeouts each, which can pass lerd's fixed 30 second hook limit when herdr or Orca is slow to answer. Nothing is left half done when it is cut off, since the workspace record is written right after the create, but shorter timeouts in the hook would keep it inside the limit.
The category is free text in the catalog so AI works, happy to keep it.
agents:watch sends its notifications fine, but it drops the answer, so a 403 after the user switched them off goes unseen; lerd's plugin guide asks for a line on stderr in that case.
With herdr 0.9.5 running, everything on the herdr side did what the README says: Open in herdr created a workspace and focused it the second time, the tab listed the agent and its button focused the right workspace, agents:watch notified on working to idle and on blocked, and the hooks recorded the workspaces they made, kept the one with a busy agent on removal and closed the idle one. I could not run Orca itself, so its repo add and set and terminal paths are untested. Once the Orca lookup is fixed, push it and point the entry here at the new commit and I'll go through the diff.
|
Thanks for running it through the VM, that screen reader catch was a good one. The entry now points at
Orca's repo add, set and terminal paths are exercised here on macOS with Orca 1.4.214; I have no Linux desktop with Orca to run them on. |
Adds
agents(https://github.com/prabowosd/lerd-agents ata7c2e052de672aa11c6d0d902bf2d26205b57352), a plugin that shows the coding agents herdr and Orca run in each site and its worktrees, and opens any checkout in either tool. It works with whichever of the two is running and skips the other.agents:statusandagents:watch, hooks onworktree.addedandworktree.removed, an MCP toolagents_statuswith a skill, and two endpoints:status(GET) andopen(POST,loopback_only, the folder checked against the site's own checkouts)./api/sites,git worktree listin the site's folder, and the JSON output of the localherdrandorcacommands. No.env, keys or secrets.herdr-workspaces.jsonin its data folder. Theworktree.removedhook closes only a workspace the hook created, never one with a working or blocked agent. Lerd itself is never changed.agents:watch, when an agent finishes or waits for input.gitand Node,lerd: ">=1.38", Linux and macOS. herdr and Orca are optional, so they are not underrequires.AI; happy to change it.plugin.yamldeclareslerdas a lower bound, andplatformsif it runs on only one..envonly when the README says why.plugin.yamland only tell the user something they need to know or act on.