Skip to content

feat(herdr): attach the one native terminal to a running agent - #57

Draft
islee23520 wants to merge 20 commits into
mainfrom
feat/herdr-agent-attach
Draft

feat(herdr): attach the one native terminal to a running agent#57
islee23520 wants to merge 20 commits into
mainfrom
feat/herdr-agent-attach

Conversation

@islee23520

Copy link
Copy Markdown
Owner

Why

ULW should be able to attach its single native terminal to a running Herdr agent so the sidebar/editor surface can show that live session without becoming a Herdr dashboard. This work landed on main locally; it is being moved onto a feature branch so the one-PTY attach contract can be reviewed (and later extended with a Spaces/Agents tree) without keeping unreviewed commits on main.

What Changed

Adds Herdr attach/detach on the existing one-PTY terminal:

  • CLI discovery (herdr --version / agent list) and a shared invocation resolver
  • TerminalTransport seam that keeps the local shell alive while a control-bridge child is attached
  • NDJSON session-control codec, atomic first-frame cutover, source-state badge, and restore-on-failure
  • Palette commands ulw.attachHerdrSession / ulw.detachHerdrSession with a QuickPick of live agents
  • Settings ulw.herdr.executablePath, ulw.herdr.socketPath, ulw.herdr.session
  • Live E2E + visual fixture for the attach cycle

Still out of scope on this branch: Activity Bar Spaces/Agents tree, status bar, auto-start/reconnect, pane/agent management UI, extra runtime dependencies. Those are the next premise, not this PR.

}

function stripHtmlComments(markdown) {
return markdown.replace(/<!--[\s\S]*?-->/g, '');
islee23520 and others added 7 commits August 23, 2026 17:23
Activity Bar lists live Herdr workspaces and agents from CLI list
commands. Clicking an agent attaches the existing one-PTY terminal;
clicking a space does not switch windows. VS Code herdr E2E waits on
visible pane output and covers tree attach before the attach cycle.
Space or Agent clicks in another folder open that folder in a new
VS Code window. Agent clicks in this window still attach the one PTY.
Herdr trees and attach stay off until ulw.herdr.enabled is true.
Refresh then lists agents even when cwd/title are null, and GUI PATH
includes ~/.local/bin so herdr is found outside a login shell.
ulw.sidebar.enabled (default true) gates the secondary-sidebar
container and view. When it is off, ULW stays an editor tab and
does not reopen the auxiliary bar.
Turning on ulw.herdr.enabled after activate now reloads the trees.
The first tree expand also loads, and failures go to the Extension
Host log as [ULW Herdr].
webpack leaves node-pty external. Packaging with --no-dependencies
omitted the native module, so GUI Code never registered
ulw.herdr.refreshExplorer and Spaces/Agents stayed empty.

Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
When ulw.herdr.enabled is on, hide the ULW sidebar terminal and attach
each same-space agent to a separate editor-group webview instead of
the shared shell PTY. Detach no longer restores a local shell.

Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
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.

2 participants