Dashboard › opencode › Distillation
a53359eb-de44-4d25-b869-a1adb52596bb["lore_tm_v1_FmnSAsqQgyATDynt3xfpuMWr70j_LYazWa4zpZPOIwU","lore_tm_v1__uUXnM7WfUgzME36E_jMTChbJUW4KZOqpLAqIkTMHqw"]
Date: Sep 14, 2026
dc661f30cb2055ad6248fdc59b14998d834497be found the existing table-based session recovery/execution implementation across migrations, generated schema, runner, recovery startup wiring, and tests.packages/core/src/database/migration/20260914170650_session-recovery.ts has ID 20260914170650_session-recovery and creates session_recovery with composite primary key (session_id, assistant_message_id); foreign keys cascade from session_id to session.id, from assistant_message_id to session_message.id, and from continuation_message_id to session_input.id.packages/core/src/database/migration/20260914214636_session-execution.ts adds required execution_id to session_recovery, creates unique index session_execution_session_idx on session_execution(session_id), and creates unique index session_recovery_execution_idx on session_recovery(execution_id).packages/core/src/database/migration/20260914222526_session-execution-phase.ts adds required text column phase to session_execution.packages/core/src/database/migration.gen.ts and session recovery/execution DDL in packages/core/src/database/schema.gen.ts; indexes shown include session_execution_owner_idx on session_execution(owner_id) and unique session_recovery_continuation_message_idx on session_recovery(continuation_message_id).packages/core/src/session/recovery.ts reads all claims from SessionExecutionTable and performs conditional matching involving SessionExecutionTable.phase and SessionExecutionTable.assistant_message_id.packages/core/src/session/runner/llm.ts imports SessionExecutionTable from ../sql and queries/updates execution state by session.id, assistantMessageID, and phases including "unknown".SessionRecovery: packages/opencode/src/server/routes/instance/httpapi/server.ts and packages/server/src/routes.ts.packages/opencode/test/mcp/session-recovery.test.ts, which spawns fixture packages/opencode/test/fixture/mcp-session-recovery.ts via Bun.spawn([process.execPath, ...]).