Preserve active subagents across reload

This commit is contained in:
jb
2026-08-27 01:05:46 -04:00
parent 4105b03981
commit 9a8169523b
6 changed files with 739 additions and 1518 deletions
+2
View File
@@ -19,6 +19,8 @@ The backend is selected automatically: Herdr is used when Pi runs in a Herdr-man
Spawn several in parallel — they run concurrently and steer results back independently as each finishes.
Running subagents survive a parent `/reload`. Their terminal sessions and completion watchers stay active, then rebind result delivery and the status widget to the fresh Pi extension runtime. Replacing or closing the parent session still cancels its running subagents. This lifecycle behavior requires Pi 0.68 or newer.
tmux panes are kept evenly sized: the extension re-applies an `even-horizontal` layout after every spawn and exit (debounced). The layout is a single constant, `SUBAGENT_TMUX_LAYOUT` in `pi-extension/subagents/tmux.ts` — change it to any named tmux layout (`main-vertical`, `tiled`, …). Herdr subagents use separate tabs, so they do not resize the parent tab.
If your shell startup is slow and launch commands get dropped before the prompt is ready, raise the delay: