Claude Code chats survive server restarts in a detachable host
A pipelines-claude-host process owns each claude -p CLI and its pipes, spools its stream-json output with offsets and serves a private Unix socket. The server detaches on shutdown and reattaches on start, replaying the spool to rebuild turns, approvals, questions, background tasks and the live model. Explicit close, idle release and CLI exit stop the host; a crashed host falls back to --resume with a notice.
This commit is contained in:
@@ -17,6 +17,7 @@ ARG PIPELINES_COMMIT=unknown
|
||||
ARG PIPELINES_DIRTY=unknown
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags "-X git.a-wan.net/alan/pipelines/internal/buildinfo.Version=${PIPELINES_VERSION} -X git.a-wan.net/alan/pipelines/internal/buildinfo.Commit=${PIPELINES_COMMIT} -X git.a-wan.net/alan/pipelines/internal/buildinfo.Dirty=${PIPELINES_DIRTY}" -o /out/pipelines-server ./cmd/pipelines-server
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags "-X git.a-wan.net/alan/pipelines/internal/buildinfo.Version=${PIPELINES_VERSION} -X git.a-wan.net/alan/pipelines/internal/buildinfo.Commit=${PIPELINES_COMMIT} -X git.a-wan.net/alan/pipelines/internal/buildinfo.Dirty=${PIPELINES_DIRTY}" -o /out/pipelines ./cmd/pipelines
|
||||
RUN CGO_ENABLED=0 go build -trimpath -o /out/pipelines-claude-host ./cmd/pipelines-claude-host
|
||||
|
||||
FROM ${OPENCODE_IMAGE}@${OPENCODE_DIGEST}
|
||||
ARG OPENCODE_VERSION
|
||||
@@ -42,6 +43,7 @@ RUN apk add --no-cache ca-certificates tzdata git curl nodejs npm python3 \
|
||||
&& chown -R pipelines:pipelines /data /workspace /home/pipelines
|
||||
COPY --from=build /out/pipelines-server /usr/local/bin/pipelines-server
|
||||
COPY --from=build /out/pipelines /usr/local/bin/pipelines
|
||||
COPY --from=build /out/pipelines-claude-host /usr/local/bin/pipelines-claude-host
|
||||
COPY --from=build /usr/local/go /usr/local/go
|
||||
COPY --chown=10001:10001 . /workspace
|
||||
ENV HOME=/home/pipelines \
|
||||
|
||||
Reference in New Issue
Block a user