docs: record Claude Code chat backend deployment
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
# Claude Code chat backend — 2026-10-22
|
||||
|
||||
Claude Code is now a third chat harness beside OpenCode and Codex. The adapter
|
||||
(`internal/claude`) owns one CLI process per active session and speaks the CLI's
|
||||
SDK stdio protocol: stream-json input/output, partial messages, and
|
||||
`--permission-prompt-tool=stdio` with the initialize handshake. The operator's
|
||||
existing Claude login and configuration are used unchanged.
|
||||
|
||||
Session identity is a generated UUID pinned with `--session-id`; after an idle
|
||||
release or server restart the next prompt resumes with `--resume`. Text and
|
||||
reasoning stream without duplicating the completed message. Tool calls, Bash
|
||||
command rows, approvals (once/always/reject with the CLI's own permission
|
||||
suggestions), AskUserQuestion forms, interrupts, live model switching, compaction
|
||||
and reported session usage/context all use the existing chat surfaces. History is
|
||||
read from Claude Code's own JSONL transcript, merged by message id with tool
|
||||
results attached, sidechains and local-command noise excluded, and paged with a
|
||||
64 MiB bound.
|
||||
|
||||
The workflow skill now installs into both OpenCode and Claude Code skill roots.
|
||||
`pipelines skill install` refreshes detected roots; an existing user-modified
|
||||
skill is refused rather than overwritten. Claude Code's initialize response lists
|
||||
the installed skill as `Pipelines`.
|
||||
|
||||
## Verification
|
||||
|
||||
- `go test ./...`, `go vet ./...`, formatting and diff checks passed; 742 web unit
|
||||
tests passed.
|
||||
- Deterministic fake-CLI tests cover streaming/dedupe, approvals allow/reject,
|
||||
question forms, interrupt, model selection and resume, transcript merging and
|
||||
paging, image/text attachments, usage, and a signed-out actionable error.
|
||||
- A real scratch-server run used the signed-in CLI and Haiku: advertised backend,
|
||||
model switch, streamed turn, a real Write approval that created the file, a
|
||||
follow-up turn on the same process, transcript readback and reported usage.
|
||||
- A real browser on a scratch server selected Claude in the create pane and saw
|
||||
the Claude harness mark on the created chat.
|
||||
- Deployed clean build `0acd7346bbd870597f6b6346a15b194068fc967e` after checking
|
||||
no pipeline run, Codex chat or other OpenCode chat was active; only the
|
||||
Pipelines server restarted, with a database/binary/plist backup at
|
||||
`~/.local/share/pipelines/backups/pre-0acd7346-20261022-182320`. The
|
||||
authenticated live check then listed `claude` and showed the Claude choice
|
||||
without creating a live chat or model turn.
|
||||
- The same restart activates the earlier transactional notification web-link fix.
|
||||
- Not tested: Flutter tooling is not installed here (the one-line capability
|
||||
change was not run through `flutter test`); native OS-specific Claude behavior
|
||||
outside this adapter is outside this note.
|
||||
+1
-1
@@ -638,7 +638,7 @@ fills its scroll pane at 1100px. Captures: `wrapped-run-title-390.png`,
|
||||
| B22 | Agent badge on chat rows | — | done — every chat row shows the harness mark at its right edge (OpenCode terminal, Codex hex, Claude starburst, Pi), with the harness name as tooltip/aria-label. OpenCode is the default for legacy rows; Codex rows carry their backend from the adapter. The model switcher is hidden for harnesses that do not support it. |
|
||||
| B23 | Preload a new chat's behavior | `chat_create.instructions` | done — the New chat pane now has an editable **How should it act?** brief, prefilled with a project-agnostic care/verification brief. `chat_create` carries it as `instructions`; OpenCode stores it as the durable `pipelines.behavior` session instruction entry before the first turn, so the agent starts with the brief. Other harnesses and older OpenCode builds still create the chat if the instruction surface is unavailable. Verified live with an ephemeral create: the instruction entry was present immediately after creation. |
|
||||
| B13 | Codex chat backend | `chat_backends`, `chat_create.backend` | done — OpenCode stays the default. `chat_backends` lists `codex` when the Codex App Server control socket is present; New chat shows a harness choice, the selected backend is stored on the operator-session row and echoed on every session. The Codex adapter connects to the existing App Server over its Unix WebSocket, maps `thread/start`, `turn/start`, `thread/read`, item/tool events, `item/tool/requestUserInput` to the existing question card, and carries the native user-message id so optimistic and history turns reconcile. Verified live: created a Codex chat from the browser, sent a prompt, saw the streamed answer, read it back through `chat_messages`, and saw the Codex chip and title in the list. |
|
||||
| B24 | Claude Code chat backend | `chat_backends`, `chat_create.backend` | done — `chat_backends` lists `claude` when the `claude` CLI is installed (`PIPELINES_CLAUDE` overrides the path). The adapter owns one CLI process per session with stream-json input/output, performs the initialize handshake, resumes the same session after an idle release/restart, and uses the operator's existing login without changing Claude settings. Text/reasoning stream with duplicate suppression; tool cards, Bash command rows, `can_use_tool` approvals (once/always/reject with the CLI's own suggestions), `AskUserQuestion` forms, interrupts, live model switching and reported session usage/context all use the existing surfaces. History comes from Claude Code's own JSONL session file, merged by message id with tool results attached, sidechains excluded and bounded paging. Verified against a scratch server and the real signed-in CLI: advertised backend, Haiku model switch, streamed turn, real Write approval and file creation, follow-up turn on the same process, transcript readback and reported usage. The web/Flutter model pickers include Claude; native OS-specific checks remain outside this row. |
|
||||
| B24 | Claude Code chat backend | `chat_backends`, `chat_create.backend` | done — `chat_backends` lists `claude` when the `claude` CLI is installed (`PIPELINES_CLAUDE` overrides the path). The adapter owns one CLI process per session with stream-json input/output, performs the initialize handshake, resumes the same session after an idle release/restart, and uses the operator's existing login without changing Claude settings. Text/reasoning stream with duplicate suppression; tool cards, Bash command rows, `can_use_tool` approvals (once/always/reject with the CLI's own suggestions), `AskUserQuestion` forms, interrupts, live model switching and reported session usage/context all use the existing surfaces. History comes from Claude Code's own JSONL session file, merged by message id with tool results attached, sidechains excluded and bounded paging. Verified against a scratch server and the real signed-in CLI: advertised backend, Haiku model switch, streamed turn, real Write approval and file creation, follow-up turn on the same process, transcript readback and reported usage. The web/Flutter model pickers include Claude; native OS-specific checks remain outside this row. After deployment, an authenticated live browser check listed `claude` in `chat_backends` and offered Claude in the create pane without creating a live chat or model turn. |
|
||||
| B12 | One detail header, optimistic sends, thinking above the bubble | — | done — every non-chat detail (pipeline, run, template) now extracts its own `#detailTitle` into a shared `.detail-head` with the same 44px chevron Back control; on phones the button and title are vertically centred, and on wide screens the back control is hidden while the title stays in the header. Chat/create already use the same control. Sending now appends the operator's optimistic user turn immediately (using the native message id OpenCode persists), so the running placeholder cannot appear before their message. While a turn runs, Send stays present beside Stop; a follow-up is queued. The reasoning/thinking block moved outside and above the answer bubble, like the tool summary below it. |
|
||||
| B11 | Enter composes; live shell bars stay in place | — | done — Enter now inserts a newline (a real CDP Enter produced `first\n` and no prompt), while Ctrl/Cmd+Enter sends; a slash draft still runs its command on Enter. The chat star reserves a 26px corner in the row head, so it no longer covers Streaming/New/Idle. Background-shell frames patch the tasks bar in place instead of full-rendering the pane, keeping the composer mounted. The shell cache was bumped to v2 so an installed PWA picks up these client changes. |
|
||||
| B10 | Chat titles are shared across devices | `chat_rename` | done — the rename dialog writes the title to the server's operator-session registry (`SetOperatorSessionTitle`) instead of a device-local override. `chat_sessions` already prefers that title, so a second browser opened with a fresh profile showed `Shared rename probe` without any local storage; restoring it to `New chat` did the same. Old local titles are uploaded once on the next list load and then removed. The helper now reads `This name is shared with every device.` |
|
||||
|
||||
Reference in New Issue
Block a user