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
+1
View File
@@ -49,6 +49,7 @@ func fakeNativeService(t *testing.T) {
t.Setenv("HOME", t.TempDir())
state := t.TempDir()
t.Setenv("XDG_STATE_HOME", state)
t.Setenv("PIPELINES_OPENCODE_STAGE_SERVICE", "shared") // fixture models the shared CLI-managed service
t.Setenv("XDG_CACHE_HOME", t.TempDir())
if err := os.Mkdir(filepath.Join(state, "opencode"), 0700); err != nil {
t.Fatal(err)