Merge main; use the shared chatShutdownDetacher for OpenCode and Codex

OpenCode and Codex chats implement Detach (called by chatManager.Close)
instead of a parallel DetachSessions interface. Docs follow the Claude Code
host and the systemd KillMode=process unit. The opt-in live restart check
copies only the stage provider's login row into its scratch OpenCode
database, builds the CLI for skill install and removes its scratch tree.
This commit is contained in:
2026-11-04 16:24:17 +00:00
26 changed files with 2463 additions and 101 deletions
+8 -7
View File
@@ -42,7 +42,8 @@ Linux needs `systemctl --user`. Other platforms are refused.
2. Builds the Flutter web app in Docker (pinned to `app/.flutter-version`).
Builds are cached in `~/.cache/pipelines/app-builds` by a digest of the app
sources, so an unchanged app is reused.
3. Builds `pipelines-server` and `pipelines` with `go build -trimpath`.
3. Builds `pipelines-server`, `pipelines` and `pipelines-claude-host` (keeps
Claude Code chats alive across server restarts) with `go build -trimpath`.
4. Installs into the prefix: binaries in `bin/`, web app in `lib/app-web`, web
proxy in `lib/web`, `lib/manage.py`, and an empty `lib/app-updates` for APKs.
5. Runs `pipelines skill install` (the authoring skill for OpenCode and Claude
@@ -222,11 +223,11 @@ endpoint, keeps running and is reused. Stop it by killing the `pid` in
clients as before, add `"PIPELINES_SHUTDOWN_SESSIONS": "stop"` to
`opencode_env` in `<prefix>/pipelines-install.json` and restart.
Limit on Linux: systemd stops every process in the service's cgroup. The
OpenCode services the server starts (stage service, owned chat service) end
with `pipelines stop`/`restart`, and their runs fall back as described above.
An attached OpenCode endpoint and the Codex App Server are separate and
survive. macOS launchd does not kill them.
The OpenCode services the server starts (stage service, owned chat service)
run in their own process session, so macOS launchd leaves them running. The
systemd unit uses `KillMode=process`, so Linux stops only the supervisor, which
stops its own children; the detached services survive. An attached OpenCode
endpoint and the Codex App Server are separate processes anyway.
The login service is `~/Library/LaunchAgents/net.a-wan.pipelines.plist` on
macOS and `~/.config/systemd/user/net.a-wan.pipelines.service` on Linux. It
@@ -238,7 +239,7 @@ autostart, not boot-without-login.
| Path | Contents |
| --- | --- |
| `<prefix>/pipelines-install.json` | manifest (ports, paths, install args, environment) |
| `<prefix>/bin/` | `pipelines`, `pipelines-server`, `ntfy` |
| `<prefix>/bin/` | `pipelines`, `pipelines-server`, `pipelines-claude-host`, `ntfy` |
| `<prefix>/data/pipelines.db` | SQLite database (definitions, runs, chats, settings) |
| `<prefix>/data/artifacts/` | run artifacts and session exports |
| `<prefix>/data/ntfy/` | ntfy config, cache and accounts |