Keep OpenCode/Codex chat and stage sessions running across server restarts

A stopping server no longer interrupts harness sessions. Runs are canceled
with a shutdown cause, so stage clients leave admitted sessions running and
owned; start-up recovery re-adopts live OpenCode V2 stage sessions (wait,
read back the result, continue the graph), restarts unadmitted visits,
continues runs between stages, and falls back to interrupted with a reason
when the harness is gone. Chats with live work are recorded on shutdown and
reattached on start; turns that ended during the downtime are folded in
from history. The server-spawned V2 chat serve is now a detached owned
service. PIPELINES_SHUTDOWN_SESSIONS=stop restores the old behaviour.
This commit is contained in:
2026-11-04 16:17:08 +00:00
parent 9351cd7d74
commit aa8eddd686
26 changed files with 2318 additions and 99 deletions
+4 -1
View File
@@ -92,7 +92,10 @@ How the stage service behaves:
session is active on it. A busy service keeps its old limits until it is idle.
- **Lifetime.** It runs detached in its own process session, so a stopping
Pipelines service does not take active stage work with it. On server shutdown
it is stopped only when no session is active on it. Otherwise restart
it is stopped only when no session is active on it. A busy service keeps
running, and the next start re-adopts its sessions and continues their runs
(see [Installation](install.md#restarts-keep-sessions-running)). With
`PIPELINES_SHUTDOWN_SESSIONS=stop`, or when the service is gone, restart
recovery interrupts the retained sessions through it, as before.
- `pipelines debug` is unchanged: it opens a fresh interactive harness
conversation, not the stage session.