Dashboard › opencode › Distillation
3f2445ff-3b63-4390-9be9-c9c9acccdb38["lore_tm_v1_unEQowyaKgpYs6QUN36GTiWiTiGAdm_ZsvtkIocdlLM","lore_tm_v1_fX5uFwAGR6tBmiCe72XcfOvsRwtc9NczbLAYjXC2rd8","lore_tm_v1_uVPCIwObkYsfkX-AS5CVT01ofqQvuP2lDobtRVqbAvI","lore_tm_v1_M9KmGPiKHyCmEcnwWw0wxObSyMB3KfWS0FfwFMjirXM","lore_tm_v1_OLKsD0qIC1YHYEDK-i430OY3Tw_UDgywTXOMVJIif5g","lore_tm_v1_yPjuDtHMquVFXzcnfiXcBkYVDseLw10Fu2DoojSlq_A","lore_tm_v1_U2hYz4pyYN1ZM4f0xUD8R-YrYBdQK0LC-bCUMpwnWIg"]
Date: Sep 14, 2026
/home/byk/Code/opencode/packages/schema/src/durable-event-manifest.ts is a 15-line manifest exporting DurableEventManifest; SessionDurable contains definitions: Event.durable(SessionEvent.DurableDefinitions) and schema: SessionEvent.Durable.Durable in /home/byk/Code/opencode/packages/schema/src/durable-event-manifest.ts combines durable definitions from SessionV1.Event.Definitions.filter((definition) => definition.durable !== undefined) with all SessionEvent.DurableDefinitions, then indexes them through Event.durable(...)./home/byk/Code/opencode/packages/core/test/session-runner.test.ts, /home/byk/Code/opencode/packages/core/test/database-migration.test.ts, /home/byk/Code/opencode/packages/core/test/event.test.ts, /home/byk/Code/opencode/packages/core/test/background-job.test.ts, /home/byk/Code/opencode/packages/core/test/state.test.ts, /home/byk/Code/opencode/packages/core/test/session-prompt.test.ts, /home/byk/Code/opencode/packages/core/test/session-create.test.ts, /home/byk/Code/opencode/packages/core/test/session-runner-tool-registry.test.ts, and /home/byk/Code/opencode/packages/core/test/tool-apply-patch.test.ts./home/byk/Code/opencode/packages/core/test/session-runner.test.ts lines 2233-2259 test steering accepted during an active provider failure: initial prompt "Start working" is followed by steering "Recover with this" while the first stream is gated; the first fiber fails with streamFailure, then a second request contains both user texts in order./home/byk/Code/opencode/packages/core/test/session-runner.test.ts lines 2262-2319 test prior-process recovery for a local echo tool. After publishing SessionEvent.Step.Started, SessionEvent.Tool.Input.Started, SessionEvent.Tool.Input.Ended, and SessionEvent.Tool.Called for callID: "call-interrupted" with input { text: "stale" } and provider: { executed: false }, session.resume(sessionID) sends roles ["user", "assistant", "tool"] and projects the tool state as { status: "error", error: { type: "unknown", message: "Tool execution interrupted" } }./home/byk/Code/opencode/packages/core/test/session-runner.test.ts lines 2322-2380 test prior-process recovery for hosted tool web_search. The stale call call-hosted-interrupted has input { query: "stale" } and provider metadata { executed: true, metadata: { openai: { itemId: "call-hosted-interrupted" } } }; resume sends roles ["user", "assistant"] with an inline provider-executed tool-call followed by a provider-executed tool-result whose result is { type: "error" }./home/byk/Code/opencode/packages/core/test/session-runner.test.ts lines 2382-2419 test pending tool input left by a prior process. A SessionEvent.Tool.Input.Started for call-pending-interrupted and tool echo, without completed input or call, is durably recovered on resume; the provider receives roles ["user", "assistant", "tool"], and session context contains the assistant tool state { status: "error" }./home/byk/Code/opencode/packages/core/test/session-runner.test.ts lines 2421-2439 test that waking an idle session promotes the first queued input: prompt text "Wait in queue" uses delivery: "queue" and resume: false; (yield* SessionExecution.Service).wake(sessionID) produces exactly one request containing that text./home/byk/Code/opencode/packages/core/test/session-runner.test.ts lines 2441-2465 test retry after prompt projection rollback. A SessionEvent.Prompted projector initially dies with new Error("fail after prompt promotion"); the first session.resume(sessionID) exposes that defect, then after disabling the failure and waking the session, the next provider request still contains "Recover promoted input"./home/byk/Code/opencode/packages/core/src/session/history.ts defines latestCompaction(db, sessionID), which selects the newest SessionMessageTable.seq for a "compaction" message by descending sequence, limits to one row, and converts database failure to a defect with Effect.orDie.messageRows() in /home/byk/Code/opencode/packages/core/src/session/history.ts selects session messages in ascending sequence. With a compaction, it includes rows at or after the compaction and can additionally include system messages after baselineSeq; with a baseline, it excludes system messages at or before that baseline.decodeMessageRow() in /home/byk/Code/opencode/packages/core/src/session/history.ts decodes { ...row.data, id: row.id, type: row.type } through SessionMessage.Message; decoding failures become MessageDecodeError carrying branded sessionID and messageID.SessionHistory.load() concurrently retrieves the current SessionContextEpochTable.baseline_seq and latest compaction with { concurrency: "unbounded" }, then loads and decodes the selected message rows.SessionHistory.loadForRunner(db, sessionID, baselineSeq) maps entriesForRunner(...) to messages only; entriesForRunner() returns decoded { seq: row.seq, message } entries using the latest compaction and supplied baseline./home/byk/Code/opencode/packages/core/src/session/run-coordinator.ts defines Coordinator<Key, E> for per-key serialized execution while allowing different keys concurrently. Its API is active, run(key), wake(key), and interrupt(key), backed by entries containing done, optional owner, pendingWake, and stopping.SessionRunCoordinator.make() accepts drain(key, force), stores active entries in Map<Key, Entry<E>>, and owns execution fibers through FiberSet.makeRuntime<never, void, never>().start() in /home/byk/Code/opencode/packages/core/src/session/run-coordinator.ts gates ordinary starts on a Deferred, yields before successor starts, calls options.drain(key, force), and always passes the exit to settle().settle() coalesces wakeups: after a successful drain, a non-stopping entry with pendingWake immediately starts one non-forced successor on the same entry; otherwise it either removes the key or installs a fresh successor when work remains, then completes the old entryβs done deferred with the original exit.run(key) in /home/byk/Code/opencode/packages/core/src/session/run-coordinator.ts uses Effect.uninterruptibleMask: it joins an existing active execution, waits through a stopping entry and retries, or creates a new entry and starts drain(key, true).wake(key) sets pendingWake = true for an active entry, coalescing repeated wakeups, or creates an entry and starts drain(key, false) when idle. interrupt(key) marks an owned entry as stopping, clears pendingWake, and calls Fiber.interrupt(entry.owner); absent owners are a no-op.Layer.effectDiscard returned 51 matches across core services. Global-node definitions were found in src/global.ts, src/ripgrep.ts, src/repository-cache.ts, src/models-dev.ts, src/fs-util.ts, src/tool-output-store.ts, src/session.ts, src/project.ts, src/process.ts, src/npm.ts, src/git.ts, src/event.ts, src/cross-spawn-spawner.ts, src/credential.ts, src/background-job.ts, src/ripgrep/binary.ts, src/database/database.ts, src/control-plane/move-session.ts, src/skill/discovery.ts, src/session/projector.ts, src/session/store.ts, src/session/execution/local.ts, src/pty/ticket.ts, src/project/directories.ts, src/permission/saved.ts, src/util/effect-flock.ts, and src/effect/app-node-platform.ts.Layer.effectDiscard usage in src/tool-output-store.ts, src/instruction-context.ts, src/tool/apply-patch.ts, src/system-context/builtins.ts, src/session/projector.ts, src/project/copy.ts, src/tool/question.ts, src/tool/grep.ts, src/tool/glob.ts, src/tool/write.ts, src/tool/edit.ts, src/tool/websearch.ts, src/tool/bash.ts, src/tool/webfetch.ts, src/tool/todowrite.ts, src/tool/read.ts, src/tool/skill.ts, and src/plugin/internal.ts./home/byk/Code/opencode/packages/core/src/tool-output-store.ts cleanup scans directory entries beginning with "tool_", reads each fileβs mtime, defaults a missing modification time to 0, and removes files older than cutoff; stat and removal failures are ignored./home/byk/Code/opencode/packages/core/src/tool-output-store.ts exports a location-scoped node depending on FSUtil.node, Global.node, and Config.node, plus nodeWithoutConfig depending only on FSUtil.node and Global.node.cleanupLayer in /home/byk/Code/opencode/packages/core/src/tool-output-store.ts runs retention scanning once globally rather than once per active Location: it invokes store.cleanup(), repeats it on Schedule.spaced(Duration.hours(1)), and forks the loop with Effect.forkScoped.cleanupNode in /home/byk/Code/opencode/packages/core/src/tool-output-store.ts is a global node named "tool-output-cleanup" whose layer merges layer with cleanupLayer.pipe(Layer.provide(layer)); its dependencies are FSUtil.node and Global.node.