Repository navigation
Description
First, thank you. I have been running SwarmForge locally on real projects, and the discipline it imposes on a group of agents is the part I did not expect: role prompts plus a layered constitution plus worktree isolation plus a handoff queue turns a pile of agents into something that behaves like an engineering team rather than a chat window. The two-pack / four-pack / six-pack progression is a genuinely good design, and being able to watch the whole chain run is what makes it trustworthy. Thank you also for the decades of writing and teaching that led here — a great deal of how I think about this work came from your books before I ever ran this repo.
This issue is about one small operational thing I ran into while watching a six-pack.
What happens today
Every terminal backend (terminal-app, iterm2, ghostty, windows-terminal) opens one window per role, which is the correct default: each window is independently trackable, and swarm-window-watchdog.sh can reopen one a role loses.
The consequence at six roles is that the swarm has no single surface. Measured on a stock six-pack run:
distinct OS windows holding the swarm: 6
window frame=69,51 size=865x458 tiles=1
window frame=1055,25 size=865x458 tiles=1
window frame=162,94 size=865x458 tiles=1
window frame=34,77 size=865x458 tiles=1
window frame=89,546 size=865x458 tiles=1
window frame=746,37 size=865x458 tiles=1
Six windows of the same size, at cascading offsets, so they overlap each other and whatever else is open. Watching the specifier -> coder -> cleaner -> architect -> hardender -> QA chain means hunting for windows, and the window manager decides which roles are visible at any moment. There is no window that is the swarm, so there is also nothing to put on a second monitor, screenshot for a run log, or hand to someone else to watch.
What I would like instead
An opt-in backend that tiles the roles into one surface:
+---------------+---------------+
| Specifier | Coder |
+---------------+---------------+
| Cleaner | Architect |
+---------------+---------------+
| Hardender | QA |
+---------------+---------------+
Two things such a feature has to respect:
-
It must not disturb the role sessions. Handoff delivery targets a bare session name (
tmux send-keys -t swarmforge-<role>), which tmux resolves to that session's current window's active pane.tmux join-panewould move a role's only pane into another session's window, destroying the role's session and therefore its delivery address. So the tiling cannot be done by moving role panes. -
It should arrive as one more adapter behind the existing contract, not as a change to the ones that work. The adapter layer already isolates the platform-specific part behind
terminal_backend_label/can_open_sessions/tracks_windows/open_session/window_exists/close_window, andterminal_backend_tracks_windowsalready exists precisely for a backend whose surfaces are not reopenable windows. A grid needs no new hook and no new branch inswarmforge.bb.
Both are satisfiable by letting tmux do the tiling: one extra, disposable viewer session whose panes each run tmux attach-session -t swarmforge-<role>, plus select-layout tiled. Every role session stays exactly one session, one window, one pane; the daemon, the handoff routing, and CURRENT_TASK never learn that the presentation changed.
Doing it in tmux rather than in a terminal emulator also means one adapter covers every host SwarmForge already runs on — macOS, Windows Terminal under WSL, and Linux, including a host with no terminal automation, where the grid is simply attached in the current shell. It keeps the tests free of any window system as well: they drive tmux and assert the real pane layout.
The existing terminal_backend_tracks_windows hook already covers the bookkeeping consequence: a tile is not a reopenable window, so the backend answers false, SwarmForge writes no window-ids file, starts no watchdog, and already prints that it has done so.
Proposed scope
- One new adapter,
swarmforge/scripts/terminal-adapters/tmux-grid.sh, selected withSWARMFORGE_TERMINAL=tmux-grid. - No change to any existing backend; one line added to
terminal-helpersinswarmforge.bbso a broken install is still caught at startup. - The single OS window is opened by delegating to an existing single-window backend, auto-detected as usual or named with
SWARMFORGE_GRID_TERMINAL. - Tests that drive tmux directly, so the pane layout, the pane titles, the survival of every role session, and the viewer session's lifetime are all asserted without any dependency on a window system.
I have this working and tested, and I am happy to open it as a PR — or to close this and leave it as a note if you would rather the presentation layer stay as it is. Either way, thank you for the tool.
Activity