Dashboard › opencode › Distillation
3fd4525a-7b16-4b45-a1be-4a32bd7fbdd2["lore_tm_v1_WiFbd_yeXnfJAImjn1C-R6-8fgOqwrNayiXE39yLFq8","lore_tm_v1_7VdfPzu5t1kDErVNK1zKACxRkQ_gs1SD73-tqOodqTo","lore_tm_v1_NOtpwXQV_yQiCO0N-ezplNWM-gIJD4_UQ48UekuLYiY","lore_tm_v1_xEYD4CQoFgOa-1_dFFi-TRvSIg92HuVX1hooIAe5yak","lore_tm_v1_xs_yL6f4TmwPv5m459deN-GLnetc4AGAkWn-_giIQH8","lore_tm_v1_3HKzugW5bUHuZU0iQMqipXPr3d5wEZR_39rtxsYXK7o"]
Date: Sep 16, 2026
/tmp/opencode/session-recovery-v7-check/packages/core/src/session/sql.ts defines MAX_WAKE_ATTEMPTS = Number.MAX_SAFE_INTEGER; both SessionTable.wake_attempts and SessionRecoveryTable.wake_attempts default to 0 and are constrained between 0 and MAX_WAKE_ATTEMPTS.SessionInputTable in /tmp/opencode/session-recovery-v7-check/packages/core/src/session/sql.ts includes delivery, admitted_seq, nullable promoted_seq, and boolean wake_pending defaulting to false; it has unique indexes on (session_id, admitted_seq) and (session_id, promoted_seq), plus session_input_wake_pending_promoted_session_idx on (wake_pending, promoted_seq, session_id).SessionRecoveryTable in /tmp/opencode/session-recovery-v7-check/packages/core/src/session/sql.ts stores session_id, execution_id, nullable assistant_message_id, required continuation_message_id, phase "ready" | "unknown" | "continue", wake_pending defaulting to true, wake_attempts defaulting to 0, nullable recovery_error, and time_created. Its primary key is execution_id; continuation_message_id is unique; wake scanning uses index session_recovery_wake_pending_error_attempts_created_execution_idx on (wake_pending, recovery_error, wake_attempts, time_created, execution_id).SessionRecoveryTable foreign keys cascade on deletion from SessionTable, SessionMessageTable via assistant_message_id, and SessionInputTable via continuation_message_id.SessionExecutionTable in /tmp/opencode/session-recovery-v7-check/packages/core/src/session/sql.ts stores id, session_id, owner_id, nullable assistant_message_id, phase "ready" | "safe" | "unknown" | "continue", time_created, expires_at, and nullable recovery_error. It uses primary key session_execution_pk on id, unique index session_execution_session_idx on session_id, index session_execution_owner_idx on owner_id, and check session_execution_phase_check./tmp/opencode/session-recovery-v7-check/packages/core/src/session/sql.ts defines SESSION_EXECUTION_LEASE_MS = 30_000./tmp/opencode/session-recovery-v7-check/packages/core/src/database/migration/20260914170650_session-recovery.ts, with ID 20260914170650_session-recovery, adds session_input.wake_pending defaulting to false, adds session.wake_attempts defaulting to 0 with bounds 0..9007199254740991, creates session_execution and session_recovery, and creates their execution-owner, session, continuation-message, and wake-scanning indexes.session_execution.phase check allows exactly 'ready', 'safe', 'unknown', and 'continue'; session_recovery has no corresponding SQL phase check in this migration, although its TypeScript schema type is "ready" | "unknown" | "continue"./tmp/opencode/session-recovery-v7-check/packages/server/src/routes.ts includes SessionRecovery.node in applicationServices; makeRoutes() builds services with AppNodeBuilder.build(applicationServices, [[SessionExecution.node, SessionExecutionLocal.node]]), wiring SessionExecution.node to SessionExecutionLocal.node./tmp/opencode/session-recovery-v7-check/packages/server/src/routes.ts serves OpenAPI at /openapi.json; createRoutes(password?) configures username "opencode" with an optional password, while createEmbeddedRoutes() configures username "opencode" with Option.none()./tmp/opencode/session-recovery-v7-check/packages/opencode/src/server/routes/instance/httpapi/server.ts, createRoutes() merges rootApiRoutes, eventApiRoutes, ptyConnectApiRoutes, instanceRoutes, serverRoutes, docRoute, and uiRoute; it provides SessionV2.node and SessionRecovery.node together, maps LocationServiceMap.node to locationServiceMapV2, and maps SessionExecution.node to SessionExecutionLocal.node.Uint8Array rather than repeatedly re-stringifying the specification./tmp/opencode/session-recovery-v7-check/packages/opencode/src/server/routes/instance/httpapi/server.ts requires Observability.layer to remain the final provided layer because later-provided layers build beneath earlier ones; otherwise eagerly forked fibers such as the ModelsDev background refresh capture Effect’s default stdout logger and corrupt the TUI, tracked as #34730.webHandler is lazy and calls HttpRouter.toWebHandler(routes, { disableLogger: true, memoMap, middleware: disposeMiddleware }).