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:
@@ -54,6 +54,9 @@ type chatHub struct {
|
||||
// queueStore persists prompts queued behind a running turn; nil keeps the
|
||||
// queue in memory only (tests and store-less servers).
|
||||
queueStore chatPromptQueueStore
|
||||
// liveStore records the chats a stopping server leaves live on their
|
||||
// harness (chat_detach.go); nil reattaches nothing beyond the start probe.
|
||||
liveStore chatLiveStore
|
||||
// recentOps/recentOpOrder are the bounded record of accepted prompt
|
||||
// operation ids, so a client retry is acknowledged instead of re-sent.
|
||||
recentOps map[string]struct{}
|
||||
|
||||
Reference in New Issue
Block a user