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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user