Skip to content

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

Merged
islee23520 merged 21 commits into
mainfrom
feat/herdr-agent-attach
Sep 7, 2026
Merged

feat(herdr): attach the one native terminal to a running agent#57
islee23520 merged 21 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 8 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>
- ulw.herdr.remoteTarget: on remote windows ULW forwards the remote Herdr API
  and client sockets over SSH (dual -L, readiness poll, generation-guarded
  restarts) and injects HERDR_SOCKET_PATH/HERDR_CLIENT_SOCKET_PATH into every
  invocation; herdr 0.8.0 rejects --remote with subcommands, so remote windows
  use socket forwarding instead of the --remote flag
- Herdr attach scroll: wheel/PageUp/PageDown route to Herdr host history via
  terminal.scroll plus a same-size resize checkpoint instead of typing into the
  agent prompt; source badge reflects the attached session
- Spaces/Agents trees poll while Herdr mode is enabled
- Agent editor tabs track focus: global input/resize/detach follow the active
  tab, inactive panels are ignored, and closing the focused tab falls back to
  the most recently focused remaining agent
- Herdr setting changes apply to new invocations without reloading the window
@islee23520
islee23520 marked this pull request as ready for review September 7, 2026 15:30
@islee23520
islee23520 merged commit b8674e8 into main Sep 7, 2026
3 of 4 checks passed
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