chat: add the Codex backend

Store a chat's harness with its operator session, expose chat_backends and a
backend choice in New chat, and route each session through a manager. The Codex
adapter uses the App Server's Unix WebSocket for threads, turns, history,
questions and interrupt; OpenCode remains the default and Claude is not
advertised until its sidecar and login are wired.
This commit is contained in:
2026-10-20 12:10:39 +01:00
parent 74b74adee7
commit f7a3a49f94
25 changed files with 1287 additions and 32 deletions
+7
View File
@@ -121,6 +121,13 @@ func main() {
openCodeStatus.Health = "unavailable"
}
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.
chats := server.NewChatManager(ctx, options.Chat, store)
if len(chats.Backends()) > 0 {
options.Chat = chats
defer chats.Close()
}
srv := &http.Server{Addr: *addr, Handler: server.HandlerWithOptions(ctx, options, store), ReadHeaderTimeout: 5 * time.Second}
defer server.WaitRuns(srv.Handler)
go func() {