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
+8
View File
@@ -936,6 +936,7 @@ export function defaultDirectoryChoice(choices) {
export function newChatCreateState(operationId) {
return {
directory: HOME_DIRECTORY,
backend: "opencode",
operationId: str(operationId),
creating: false,
error: "",
@@ -954,6 +955,13 @@ export function selectChatDirectory(create, choice) {
return { ...create, directory, error: "" };
}
/** Choose the harness for a new chat. */
export function selectChatBackend(create, backend) {
const value = str(backend);
if (value === "") return { ...create };
return { ...create, backend: value, error: "" };
}
/** The create failed: stop sending and keep the server's own reason in the pane. */
export function chatCreateFailed(create, message) {
return { ...create, creating: false, error: str(message) };