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:
@@ -0,0 +1,23 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user