Dashboard › opencode › Distillation
d14b4c55-19db-4914-862d-a4d892366c09["lore_tm_v1_pl3nktTffJXRGHvy-KloA_sqeb_mefcVJkf_OMYKCao","lore_tm_v1_WSQIbMKbmqQTmtiWXOzUP099aBjtoEex-_9bajf0DSw"]
Date: Sep 14, 2026
packages/core/src/session/sql.ts, packages/core/src/session/input.ts, packages/core/src/session/runner/llm.ts, packages/core/src/session/execution/local.ts, packages/core/src/event.ts, packages/core/src/session/projector.ts, packages/server/src/routes.ts, and packages/opencode/src/server/routes/instance/httpapi/server.ts.seq and filtering where json_extract(data, '$.time.completed') IS NULL; to identify interrupted tools, it proposed adding a json_each(data, '$.content') predicate for tool state.status equal to pending or running.SessionMessageTable stores session_id, type, durable seq, and encoded data at /home/byk/Code/opencode/packages/core/src/session/sql.ts:119-137; its (session_id, seq) index is unique at :132-135; the projector identifies the current assistant as the newest assistant by descending seq and treats it as active only if time.completed is absent at /home/byk/Code/opencode/packages/core/src/session/projector.ts:133-149; and the runner recognizes projected tool states pending and running at /home/byk/Code/opencode/packages/core/src/session/runner/llm.ts:119-138.Step.Started projection, so a crash after input promotion but before provider output may leave no incomplete assistant; current durable state identifies dangling projected work only.SessionInput.admit checks by message ID and publishes PromptAdmitted at /home/byk/Code/opencode/packages/core/src/session/input.ts:41-81, but cannot conditionally acquire a distinct recovery claim. EventV2.claim at /home/byk/Code/opencode/packages/core/src/event.ts:525-532 unconditionally updates event_sequence.owner_id; it is replay ownership rather than Session execution ownership and is not compare-and-set.EventV2.publish(..., { commit }): PublishOptions.commit is declared at /home/byk/Code/opencode/packages/core/src/event.ts:118-124, while event persistence, projectors, and the commit hook execute in one SQLite IMMEDIATE transaction at :237-353.(session_id, recovery_boundary_seq), acquired through a conditional insert in the commit hook of one new durable recovery-admission event. The same transaction should project exactly one deterministic continuation message into session_input; losing processes should receive neither an inserted row nor an event. Assistant explicitly rejected reusing event_sequence.owner_id.SessionRecovery.startupNode composed only into server route layers. For the standalone Server, add it to applicationServices beside SessionV2.node, with AppNodeBuilder.build(...) replacing SessionExecution.node by SessionExecutionLocal.node, evidenced at /home/byk/Code/opencode/packages/server/src/routes.ts:26-37 and :51-62. For the integrated OpenCode server, add it to the V2 group built inside createRoutes, sharing the existing LocationServiceMap and SessionExecutionLocal replacement at /home/byk/Code/opencode/packages/opencode/src/server/routes/instance/httpapi/server.ts:271-304.Database, EventV2, SessionStore, and unbound SessionExecution; Server should only compose it. Core must not import Server, and recovery must not depend on legacy SessionPrompt, which belongs to the separate legacy application graph at /home/byk/Code/opencode/packages/opencode/src/server/routes/instance/httpapi/server.ts:212-269.SessionRunner.failInterruptedTools as the existing interrupted-tool reconciliation function, defined at /home/byk/Code/opencode/packages/core/src/session/runner/llm.ts:119-139 and invoked at :390-398. It loads projected context, finds every pending or running tool, and publishes SessionEvent.Tool.Failed with exact text Tool execution interrupted.SessionExecutionLocal to location-scoped SessionRunner.run({ sessionID, force }) at /home/byk/Code/opencode/packages/core/src/session/execution/local.ts:16-27; wake delegates to the coordinator at :31-36.run returns before tool reconciliation when no input is eligible, recovery must first durably admit a synthetic continue input and then call normal SessionExecution.wake(sessionID). Existing tool reconciliation does not settle an unfinished provider Step, so recovery additionally needs a durable Step.Failed-equivalent unknown-outcome event targeting the latest unfinished assistantMessageID.