Merge main; use the shared chatShutdownDetacher for OpenCode and Codex

OpenCode and Codex chats implement Detach (called by chatManager.Close)
instead of a parallel DetachSessions interface. Docs follow the Claude Code
host and the systemd KillMode=process unit. The opt-in live restart check
copies only the stage provider's login row into its scratch OpenCode
database, builds the CLI for skill install and removes its scratch tree.
This commit is contained in:
2026-11-04 16:24:17 +00:00
26 changed files with 2463 additions and 101 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ import (
// A server restart detaches from the App Server without interrupting the
// thread's turn; the next server's fresh connection still sees the turn in
// progress, then completed, through the read-only turn list.
func TestDetachSessionsLeavesTurnRunningForNextConnection(t *testing.T) {
func TestDetachLeavesTurnRunningForNextConnection(t *testing.T) {
var completed atomic.Bool
var mu sync.Mutex
var methods []string
@@ -29,7 +29,7 @@ func TestDetachSessionsLeavesTurnRunningForNextConnection(t *testing.T) {
if running, err := before.ProbeTurn(context.Background(), fixtureThread); err != nil || !running {
t.Fatalf("turn not running before the restart: %v %v", running, err)
}
before.DetachSessions()
before.Detach()
after := modelTestChat(t, appServer)
if running, err := after.ProbeTurn(context.Background(), fixtureThread); err != nil || !running {
t.Fatalf("turn did not survive the restart: %v %v", running, err)