Repository navigation
HERD-37 Start and close sessions on herdr-core-only machines - #123
Merged
makefunstuff merged 7 commits intoNov 8, 2026
Merged
Conversation
On a machine that runs only the Herdr desktop app (herdr-core), the phone can now start and close terminals there, through herdr-core's own API on the app's SSH connection: - A space's ⋯ › New › Terminal runs a shell with terminal.run (hc run --bg) in the space's folder, labelled into the space as a tab of its own (herdr.space, a new herdr.tab, where), so the desktop app and the phone both show it there. - Start work › Agent now offers a herdr-core-only machine: the agent's program runs through the login shell in the folder, in the space that sits there, and the sentence goes in once it reports a status. - Close terminal in a herdr-core agent's ⋯, and a long press on a herdr-core terminal on the machine screen, end it with terminal.kill, asked first. Classic herdr and Shepherdr keep their own new tab and close. Tests in HcStartTest; preview scenes for the menu, Start work, the sheet, and both confirmations. Fixes #99 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An agent started on herdr-core gets its first message only once it reports idle or done; one that asks first or says nothing gets no Enter, and a toast says the words didn't go in. - Agent now picks only the desktop app's own (default) session's spaces. - terminal.run passes TERM and COLORTERM. - Close runs on the app's scope, and the chat goes back once closed. - Shepherdr's spaces on the machine screen offer no long press. - A where:-only space's new terminal gets a tab of its own. - installedOn asks herdr's integrations and the probe at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A herdr-core terminal's own ⋯ has Close terminal, so the shell New › Terminal opens can be closed where it opens (scene terminal-desktop-menu). - After a close, the chat or terminal goes back only while it is still on top. - An agent that reports an error says so, not "it asks something first". - HERDR_CORE.md: the killed terminal's finished record is left to hc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Agent now on herdr-core opens the chat as soon as the agent runs; its first message goes in on the app's scope once it says it waits, else it waits in the chat's box (and a toast says why). HcStart.launch / deliver. - One rule for Close terminal on the agent's ⋯, the terminal's ⋯ and the machine screen: not in a space of Shepherdr's. - Close's toast holds no Activity; the POSIX-only line is noted for Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Agent now on herdr-core holds the sentence above the chat's box at once (the held-message list: Send now or discard by hand). deliver sends it only while it is still held, then drops it, so nothing goes twice; one that can't go in stays held. Scene chat-desktop-started. - The start is recorded as soon as the agent runs. - HcStart keeps launch and deliver only; tests go to them directly. - The agent sheet collects the session state for its Shepherdr rule. - Review shots leave the branch (they go with the PR). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ComposerStore.take claims a held row at once; Send now and Start work's first message on herdr-core both send only what they claimed, and a failed send puts it back. deliver takes a claim; a test covers words claimed elsewhere. - HeldMessage's KDoc names the one held sentence that goes by itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main brought Windows machines over herdr-core (Git Bash). hc runs a `line` with cmd.exe there, so Start work asks `uname -s` once and, on Windows, starts the agent as argv instead of the POSIX login-shell line. Test in HcStartTest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #99
On a machine that runs only the Herdr desktop app (herdr-core, no classic herdr, no Shepherdr), the phone can now start and close sessions, not just watch them. Everything goes through herdr-core's own API on the app's existing
hc connectchannel (terminal.run,terminal.kill, the same calls ashc run --bg/hc kill).What changes
terminal.run, no parent,TERM/COLORTERMset). It is labelled into the space as a tab of its own (herdr.space, a newherdr.tab,where), the way the desktop app labels its own terminals, so the desktop and the phone both show it there.argvon a Windows/Git Bash machine, where hc runs lines with cmd.exe), in the desktop space that sits in that folder, else under Other terminals. Its chat opens at once with the sentence held above the box. The sentence is sent only once the agent reportsidle/doneand only while it is still held, claimed atomically so Send now can't send it as well. Nothing is typed blind into an agent that asks something first (e.g. "trust this folder?") or reports nothing: the sentence stays held and a toast says why.terminal.kill, and the chat/terminal goes back afterwards.HcDetectionis untouched.docs/HERDR_CORE.md(new Starting and closing), README Start work and Managing from the phone.Checks
./gradlew -p core testand./gradlew :app:testDebugUnitTestpass. NewHcStartTest(16 tests) covers: placing a terminal in a space, other sessions, remote machines and Other terminals;spaceIncovering only the default session; run params (labels, env, no parent, argv on Windows); thename_takenretry; anddeliverwaiting for ready, never typing on blocked/error/silent agents, words taken over by the person, and a refused send.chat-tab-menu-desktop-only,start-desktop-only,chat-desktop-started,chat-desktop-more,chat-desktop-close,terminal-desktop-menu,machine-desktop-only-close, all looked at in both themes.argvinstead of the POSIX line on Windows, with a test.Shots
Dark theme. The light ones are on the
shots/herd-37branch (not for merge).Before (mac-mini, herdr-core only): no New › Terminal, mac-mini not offered for Agent now, no Close.
After:
🤖 Generated with Claude Code