Merge: Claude Code chats survive server restarts via a detachable host

This commit is contained in:
2026-11-04 16:15:06 +00:00
21 changed files with 2400 additions and 40 deletions
+14
View File
@@ -0,0 +1,14 @@
// Command pipelines-claude-host keeps one Claude Code CLI process alive across
// Pipelines server restarts. The server starts it; it is not run by hand. See
// internal/claudehost and docs/chat-backends.md.
package main
import (
"os"
"git.a-wan.net/alan/pipelines/internal/claudehost"
)
func main() {
os.Exit(claudehost.Main(os.Args[1:]))
}
+4
View File
@@ -13,6 +13,7 @@ import (
"time"
"git.a-wan.net/alan/pipelines/internal/buildinfo"
"git.a-wan.net/alan/pipelines/internal/claude"
"git.a-wan.net/alan/pipelines/internal/discovery"
"git.a-wan.net/alan/pipelines/internal/opencode"
"git.a-wan.net/alan/pipelines/internal/paths"
@@ -138,6 +139,9 @@ func main() {
options.OpenCodeStatus = openCodeStatus
// One manager routes each chat to its owning harness. OpenCode remains the
// default; Codex is attached when its app-server control socket is present.
// Claude Code chats run in detachable hosts scoped to this database, so a
// restart does not end them (internal/claudehost).
claude.ConfigureHosts(claude.DefaultHostDir(*db))
chats := server.NewChatManager(ctx, options.Chat, store)
if len(chats.Backends()) > 0 {
options.Chat = chats