---
id: 18542
lang: en
title: "Herdr 2 on Windows keeps AI agents running after the window closes and shows who is waiting"
published_at: "2026-11-28 10:25:26"
source_name: "Habr AI"
source_url: "https://habr.com/ru/articles/1113488/?utm_campaign=1113488&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/18542"
categories: ["research", "autonomous"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# Herdr 2 on Windows keeps AI agents running after the window closes and shows who is waiting

> **Краткая суть (BLUF):** In Windows Terminal, three or four console AI agents quickly turn into chaos: it is unclear which one is waiting for confirmation, and closing the window kills every process. In Herdr 2, a background core called herdr-core keeps the terminals alive, while the herdr-app window simply connects to it. Agents report their status themselves with the service code OSC 7501, like an indicator light on a panel: "working" or "waiting for a human." For running agents from different vendors in parallel, custom dashboards are no longer needed.  - Close the window or update the client, and agents inside herdr-core keep running - The omp and agy agents send blocked, working, and done statuses on their own, without wrappers - In a couple of days the author wrote APSam, a JS mod with launch presets and provider quotas

Imagine you have four console AI agents open, each working in its own folder. One is writing code, a second has been waiting ten minutes for you to approve a command, a third has already finished, and you accidentally close the terminal window, and all four processes die. This is exactly the problem the author of a Habr write-up ran into, and they solved it with the open-source project Herdr 2. It is a multi-agent environment: a background program called herdr-core holds all the terminals, while the herdr-app window (written in Rust with the GPUI graphics framework) only displays them. Because of this, closing the window does not kill the agents, and the terminal learns that an agent is waiting for a human through the standard OSC 7501 signal. It is a service sequence of characters that the agent writes into its output, like a traffic light switching between "go," "stop," and "wait."

## Why the tool chain had to be replaced

Starting in March 2026, the author tried to write their own manager in Delphi, but got stuck on terminal emulation inside their own window. Gradually a stack of three parts took shape around Windows Terminal. The first was dozens of tabs with the omp (oh-my-pi) and agy (antigravity-cli) agents, PowerShell, and SSH sessions. The second was a homemade dashboard on Node.js 24 showing the remaining provider quotas, the DeepSeek balance, and token counters. The third was a floating launcher, OmpLauncher, built in Delphi 13, with a folder tree, a list of the 15 most recent projects, and model presets.

For three or four projects, this was enough. Then the problems began. Switching between tabs went through PowerShell UI Automation matched by title text, so with similar titles the wrong tab would open. A permission request from an agent was not visible in the shared tab strip. Remote machines lived in separate windows, and restarting the shell killed all the processes.

## How Herdr 2 is built

Under the Herdr name on GitHub there are two branches, both under the Apache-2.0 license. The original herdrdev/herdr (over 50 thousand stars) remains a console multiplexer for the terminal. Herdr 2 came out in autumn 2026 and is split into two components: the background core herdr-core (command hc) and the desktop client herdr-app, with no Electron and no WebView. Sessions from the old console version do not show up in the new client. The author runs hc 0.1.22 and herdr-app 0.1.18 on Windows 11.

The core draws nothing. It owns all local and remote terminals and stores the tree of spaces (usually a project on a specific machine), tabs, and panes. The window is just one of the clients. Close the window or update the application, and the agents keep running and are in their same places when you open it again. Remote machines connect over SSH, and all agents appear in a single list.

Scripts and the agents themselves have a command line: hc run starts a process, hc wait waits for it to stop without a sleep loop, hc read reads the screen, and hc send sends a command. This way one agent can start a reviewer or a build on another machine. Child agents attach to the parent's tab rather than spawning new ones.

Statuses are sent via OSC 7501. The possible states are idle, working, done (the turn is finished), blocked (waiting for a human), and error. The core intercepts them and displays them in the Agents panel. The priority order is blocked, then done, working, idle. The author expected that agy would need a wrapper, but testing showed that agy 1.5.18 can already send OSC 7501. A request to trust a directory or a question to the user switches the panel to blocked, generating a response switches it to working, and finishing a turn switches it to done. Omp 19.2.1 does the same.

## The interface as a set of files and the APSam mod

All parts of the herdr-app window are JavaScript mods (running on the QuickJS engine) on top of the gpui-kit library. Layouts are stored in JSON, edits are picked up in about a second, and on error the window keeps the last working view. Built-in files are overwritten at startup, so they need to be cloned with the commands herdr-app do layout.clone and mod.clone. The application also updates the AGENTS.md file and type descriptions so that an AI agent can rearrange the interface on request.

On this basis, the author built the APSam mod in a couple of days: a Recent sidebar, a collapsible quota panel, and a launch dialog with a folder tree. Quotas refresh every 60 seconds, with bars turning yellow at 70% and red at 90%.

There are limitations too. QuickJS has no SQLite, so the token counters stayed in the old dashboard. Mods can only write files inside ~/.config/herdr-app, and the YAML preset editors still live in OmpLauncher. Launching tabs and panes from a mod returns null instead of an ID, so for renaming the author had to compare pane lists before and after. Neither omp nor agy sends the second service code, OSC 7577 (which lets an agent resume after a reboot) yet, so after a Windows restart Herdr restores the tabs and directories but launches clean shells in them.

## What this means in practice

If you work with agents from different vendors and keep git, the build, and SSH nearby, vendor desktop clients are inconvenient: they tie you to one provider or turn into several heavy windows. Herdr 2 gives you a single window, processes that survive being closed, and the standard "waiting for a human" signal. The versions are still 0.1.x, so the interface may change, and the author has moved the clean mod logic into separate modules in advance. Still, the idea of separating the process core from the window looks workable for anyone running agents in parallel.

---
- **Первоисточник:** [Habr AI](https://habr.com/ru/articles/1113488/?utm_campaign=1113488&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18542
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
