Run OpenCode stages on a Pipelines-owned stage service with their own limits

Stages now run on a detached Pipelines-owned opencode serve started with
OPENCODE_CONFIG_CONTENT carrying stage tool_output (16384 bytes / 400 lines)
and compaction.auto defaults, configurable through PIPELINES_OPENCODE_STAGE_*.
Chats keep their existing service and configuration; a server-spawned chat
serve can take PIPELINES_OPENCODE_CHAT_CONFIG. The service shares the user's
OpenCode config, credentials and session database, keeps a stable private
registration so retained references (recovery, interrupt, export) stay valid,
revives on the same port after a crash, replaces itself when idle after a
settings change, and is stopped on shutdown only when idle.
PIPELINES_OPENCODE_STAGE_SERVICE=shared restores the previous behaviour.
This commit is contained in:
2026-11-04 14:04:35 +00:00
parent fa6c0864db
commit b655278674
12 changed files with 977 additions and 15 deletions
+7 -5
View File
@@ -131,11 +131,13 @@ new`, `edit` and `debug` sessions.
`/usr/local/bin`, `/usr/bin`, `~/.local/bin`. `./install` requires `opencode`
on `PATH` and records its absolute path.
**Launched as:** the server starts its own loopback `opencode serve` for chat
and for stage sessions, using your normal OpenCode configuration and login.
A server started with `-opencode-endpoint URL` (or
`PIPELINES_OPENCODE_ENDPOINT`) attaches chat to that service instead; the
native installer does not set this.
**Launched as:** chat uses the OpenCode service the server attached to (an
endpoint from `-opencode-endpoint URL` / `PIPELINES_OPENCODE_ENDPOINT`, or a
loopback `opencode serve` the server spawns). Stage sessions run on a separate
Pipelines-owned loopback `opencode serve`, the *stage service*, which uses your
normal OpenCode configuration, login and session database but adds the stage
tool-output and compaction limits. See "OpenCode limits for stages and chats"
in [harnesses-and-control.md](harnesses-and-control.md).
**Install and sign in:** `pipelines harness setup opencode` (runs
`opencode auth login` when no provider is connected). Pipelines reads the