Files
alan f7a3a49f94 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.
2026-10-20 12:10:39 +01:00

24 lines
870 B
Go

package server
import (
"context"
"git.a-wan.net/alan/pipelines/internal/protocol"
)
// handleChatBackends lists the installed chat harnesses. Older servers answer
// with the empty field, which clients treat as OpenCode-only.
func handleChatBackends(request protocol.Message, broker chatBroker, write func(protocol.Message) error) {
backends := []string{"opencode"}
if lister, ok := broker.(interface{ Backends() []string }); ok {
backends = lister.Backends()
}
_ = write(protocol.Message{Type: protocol.ChatBackends, ID: request.ID, ChatBackends: backends})
}
// chatCreateBackend is the optional create-with-backend surface implemented by
// the multi-harness manager. A single-broker installation keeps using Create.
type chatCreateBackend interface {
CreateBackend(ctx context.Context, title, directory, backend string) (protocol.ChatSession, error)
}