Dashboard › opencode › Distillation
0a108a4a-ab17-434a-b5c1-e35e5d76f3b7["lore_tm_v1_3yAn9lIT534Mhm1V2xDziD-Zo4Q9mw_HNtldcLQqyak","lore_tm_v1_ufeOKEs_zWI2dAD0xnB_MERcZ0xFJJ7IwWgxLm5h58k","lore_tm_v1_gY_GDB4PmC_-WHMXQlNbKvWUMFajtdKD277-j13UNIQ","lore_tm_v1_JK4nOgqG-92gklUHyPGa7HME0nhJLpZYuM3LDjG2fro","lore_tm_v1_nSH_PRfsuf09FSt9_H6j9CR7iPGV-nojRe2lvOHTFt8","lore_tm_v1_PgqlAA3imOLVaDJAlmqMoi--OD1QROznA9U9jH8_qWc","lore_tm_v1_4O0_kuddRtE372jPaAkmlN_YNUqi92ZFMfRGcoWvTk8","lore_tm_v1_kTAw5ao0YAEN1z_E9JJTxeBAHDjyY8kE73PDr9Vi55Y","lore_tm_v1_YyJQECWubfIDgQJJIRJI6UOOuphLwKSnTP_4UpLRfGY","lore_tm_v1_FO_ZjqUiA6z3lXsL3XoF008_po87noswdDRfXSUnl50","lore_tm_v1_Dd4eu6_Vwd69gQhKrf6rcep1sacL9dHxg0MosGL-q6w"]
Date: Sep 14, 2026
/home/byk/Code/opencode/packages/core/src/session/store.ts: SessionStore.Interface exposes get(sessionID), context(sessionID), runnerContext(sessionID, baselineSeq), and message(messageID); Service is identified as @opencode/v2/SessionStore.SessionStore.get reads SessionTable by id and converts a found row with fromRow; context delegates to SessionHistory.load(db, sessionID); runnerContext delegates to SessionHistory.loadForRunner(db, sessionID, baselineSeq); message reads SessionMessageTable by ID and decodes { ...row.data, id: row.id, type: row.type } through Schema.decodeUnknownEffect(SessionMessage.Message), returning both the branded sessionID and decoded message. SessionStore.node depends on Database.node./home/byk/Code/opencode/packages/core/src/session/schema.ts aliases Session.ID as SessionSchema.ID and Session.Info as SessionSchema.Info from @opencode-ai/schema/session./home/byk/Code/opencode/packages/core/src/session/sql.ts defines 7 Session-related SQLite tables: SessionTable (session), MessageTable (message), PartTable (part), TodoTable (todo), SessionMessageTable (session_message), SessionInputTable (session_input), and SessionContextEpochTable (session_context_epoch).SessionTable columns are id, project_id, workspace_id, parent_id, slug, directory, path, title, version, share_url, summary_additions, summary_deletions, summary_files, summary_diffs, metadata, cost, tokens_input, tokens_output, tokens_reasoning, tokens_cache_read, tokens_cache_write, revert, permission, agent, model, ...Timestamps, time_compacting, and time_archived. project_id references ProjectTable.id with cascade deletion; numeric cost/token fields default to 0; model stores { id, providerID, variant? }. Indexes are session_project_idx, session_workspace_idx, and session_parent_idx.MessageTable stores id, cascade-linked session_id, ...Timestamps, and JSON data, with message_session_time_created_id_idx(session_id, time_created, id). Legacy PartTable stores id, cascade-linked message_id, session_id, ...Timestamps, and JSON data, with part_message_id_id_idx(message_id, id) and part_session_idx(session_id).TodoTable stores cascade-linked session_id, content, status, priority, position, and ...Timestamps; its composite primary key is (session_id, position) and its index is todo_session_idx.SessionMessageTable stores id, cascade-linked session_id, type, seq, ...Timestamps, and JSON data. Its indexes are unique session_message_session_seq_idx(session_id, seq), session_message_session_type_seq_idx(session_id, type, seq), session_message_session_time_created_id_idx(session_id, time_created, id), and session_message_time_created_idx(time_created).SessionInputTable stores id, cascade-linked session_id, JSON prompt, delivery, admitted_seq, nullable promoted_seq, and time_created defaulting to Date.now(). Its indexes are session_input_session_pending_delivery_seq_idx(session_id, promoted_seq, delivery, admitted_seq), unique session_input_session_admitted_seq_idx(session_id, admitted_seq), and unique session_input_session_promoted_seq_idx(session_id, promoted_seq).SessionContextEpochTable uses cascade-linked session_id as its primary key and stores baseline, JSON snapshot typed as SystemContext.Snapshot, and baseline_seq./home/byk/Code/opencode/packages/core/src/session/runner/index.ts defines SessionRunner.RunError as LLMError | SessionRunnerModel.Error | MessageDecodeError | ContextSnapshotDecodeError | SystemContext.InitializationBlocked | ToolOutputStore.Error. SessionRunner.Interface.run({ sessionID, force }) returns Effect.Effect<void, RunError> and is documented as running one local continuation from already-recorded Session history; explicit runs make one provider attempt even when no durable work is eligible. Service is identified as @opencode/v2/SessionRunner./home/byk/Code/opencode/packages/core/src/session/runner/llm.ts includes bounding provider retries and repeated identical tool calls; adding scoped runtime context, progress updates, and attachment normalization; and updating title, summaries, compaction state, and cleanup in bounded background work. Streaming exactly one llm.stream(request) provider turn is marked complete.SessionRunner.Service usage in /home/byk/Code/opencode/packages/core/test/session-runner.test.ts at lines 242, 538, and 3032; /home/byk/Code/opencode/packages/core/test/session-runner-recorded.test.ts at line 90; and /home/byk/Code/opencode/packages/core/src/session/execution/local.ts at line 20. The only matching service declarations were SessionRunnerModel.Service in runner/model.ts:78 and SessionRunner.Service in runner/index.ts:28./home/byk/Code/opencode/packages/core/src/session/runner/llm.ts: line 190 promotes steers up to cutoff when promotion === "steer"; lines 192-193 otherwise promote one next queued input and then steers up to cutoff.SessionExecution found 44 matches. Production bindings of SessionExecution.node to SessionExecutionLocal.node include /home/byk/Code/opencode/packages/server/src/routes.ts:52 and /home/byk/Code/opencode/packages/opencode/src/server/routes/instance/httpapi/server.ts:301; tests frequently replace it with SessionExecution.noopLayer or custom execution layers./home/byk/Code/opencode/packages/server/src/routes.ts builds applicationServices from Database.node, EventV2.node, httpClient, ToolOutputStore.cleanupNode, SessionV2.node, PermissionSaved.node, PtyTicket.node, Credential.node, PtyEnvironment.node, and LocationServiceMap.node, then binds SessionExecution.node to SessionExecutionLocal.node using AppNodeBuilder.build.createRoutes(password?) configures username "opencode" with the supplied password or uses ServerAuth.Config.layer; createEmbeddedRoutes() configures username "opencode" with no password. makeRoutes exposes OpenAPI at /openapi.json and provides, in sequence, handlers, sessionLocationLayer, locationLayer, authorizationLayer, schemaErrorLayer, auth, and the service layer. webHandler() calls HttpRouter.toWebHandler(..., { disableLogger: true }).