anomalyco / anomalyco/opencode

[FEATURE]: pluggable session execution for crash-resumable sessions

Open
#42,678 1 comment 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 15, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

Today a session lives and dies with the serving process. If the daemon or host dies mid-turn, the in-flight turn is lost; a session can't resume on another machine, and a long background run needs the process to stay alive for hours.

The v2 engine already concentrates execution behind a small abstraction: SessionExecution is four methods (active / wake / resume / interrupt), and the turn work happens in drains behind it. That abstraction is nearly a driver contract already.

The request is to let a config or env switch pick a session-execution driver, keep the in-process driver as the default, and define the contract so an external orchestrator can supply durability: crash resume mid-turn, resume on a different worker from shared storage, detached long runs.

We (@temporalio) built a working proof on a fork (https://github.com/temporalio/opencode/pull/2): the session supervisor is written once and runs under two drivers, in-process by default and as a Temporal workflow with one activity per step. A session survives kill -9 of the worker mid-turn and completes on a fresh worker; worktrees rebuild from snapshot packs in the shared store. We'd rather upstream this (and optionally a reference driver) than carry a fork, and we're happy to change it to whatever contract you'd accept.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.