Dashboard › opencode › Distillation
a70a4920-2734-438a-b3f3-5dfe14bfaae2["lore_tm_v1_Cs9ncedZ9n2r-4BUqxo1LrsQZC8iAA0fIolEE0Fl24c","lore_tm_v1_o0tAJKcmaW8TLp5a0KvW6Imc1EBTL5HXFcp6XovyJOI","lore_tm_v1_ta2lsRhT9r8qrENGietqj98OLbNq9e_qkUcGa91jx_M","lore_tm_v1_uebb04k9Q9YlpZhfEix5vVedDJA_9oS7xIHXBfVvTuE","lore_tm_v1_1qULXU-rso6-Zp7Fs45FY6JMk7tLhjXUT7CTV62t_4U","lore_tm_v1_CeCdj3VIt7iZ45KkIFMTm6FEDqoyGtTH1HJjoxgR4II","lore_tm_v1_f3OZShxieARnKAnAugfJvOdRRzqO-LsfqT3A8RSiVdE","lore_tm_v1_5avyb6ometKFxPCnuPpD4JRjJcBDrbqjM-rBKzX1YbQ","lore_tm_v1_IP2Wmq-yG5MgwywNdq0sIBvzmS8hayw5zFaZVcc8PAw","lore_tm_v1_wAm8KyVVpcbddfHdw-CZd6oDPJHiVARWoOtkGnzC4lQ","lore_tm_v1_sj77Rrv_0CkNp3EUFZTpaNNEzN-Nso7MeL0QnejKuc4","lore_tm_v1_XjEWPd286LWZAaNsyBN_eDCsVFmwl5m7xLSatDijtkM","lore_tm_v1_KIBrc57ALvDTxil4QfIXEPVsmhUS3Dy2F_SQshlYwkk","lore_tm_v1_wda5j7tVU_xOpjkAou42WNlaSBYiyrS9satDSI9y1Yc","lore_tm_v1_o_gMok2slwQBNW4tDgAovL1jb5wshhHEIy4cZMSw8WA","lore_tm_v1_oWh_PL2ZCmIh08LuGuOlIWemx3ZVuRAQKuf96drjewU","lore_tm_v1_n3X7ijsaWjWsgMswlo7F0gFGMW7ZYmN502sf0e7llBo","lore_tm_v1_u2pe8GOR_sAL4IYbWbaH_FV3rptbR5PITLznO5TlKBE","lore_tm_v1_SxVR62ZvP90JMkUEfKLNCtfdql8BBlbta1bpbrzOjF8","lore_tm_v1_dvolw8Wr5Dv3S5xXf5YC8LNR28d_X7D280Pu-WvIvhM","lore_tm_v1_0gu8NdgRgeHN8OcngNTCRuBUVSUh_e9Tcj5tc7ovuCc","lore_tm_v1_AfiMoDFBp0R6dcYuLNXscRKh6kFzL-3SYNHtBzEp0og","lore_tm_v1_DTo40h0iT1BL75lYhm2TLamiU1QNHHH79WLlTjYHbU4","lore_tm_v1_Ima2iPc3FPFPhTf7QXh2O5JRQWQjuLrSvU0wo3W8pzk","lore_tm_v1_kjXC2yRqHs2Bh1pllKSI6aBVAjwRLASLv3tjI5gOmJo","lore_tm_v1_On_yjask0cKDjEW2U77CLTlSTObpoR_H-T-ExKYEhvg","lore_tm_v1_tmHbzvA9WnvgZOXCZmVwnsfsZYH6nhiivK0mUmB6guA","lore_tm_v1_zyLQ_R4pVjU_dEut_rCxijtjwng2geg7GutaXf7QSGw","lore_tm_v1_VVjmgGw-YWMYjq-xPTIkMyupbMmZomJn1ZKVzp2WNz8","lore_tm_v1_Vi5UeynTaUtmTG_30C6C3kkyBPioaEzaBYRfstzlX54","lore_tm_v1_YHgwnKAd8Pzqz8TBcmcwg5yj_YJ7X8upOmwno4BY2mY","lore_tm_v1_ubjgrZjm6pbMXK6ET8UodpFmhKIO3KTyuwYyr57K50Q","lore_tm_v1_4HUqznZdwoHjWMiC8wrem10lbBxzDlNkSBwNclcgIxc","lore_tm_v1_XOUINqPFlRN_ZeQAkvuWLpDE-08dyCVKNgCnw5o7ZGU","lore_tm_v1_PXOQKwVZ6GKZuC0l6Vl90t_praf9N0z3n75IFN1CJ74","lore_tm_v1_21GuQsoyR5pMVLTUK82rNOCXPpRCskxiiHDxMrKTlN4","lore_tm_v1_RFXvc8PrCtEJhKFm9_5Ju6U9wC3go2vQ7nmHefy5CQA","lore_tm_v1_gpgM8KfK-Z7uAksGj537iZuhjFMGye_P6hy7LUXXYFc","lore_tm_v1_eC8s4zEf7207CrEkmjoYvDEt6AU29FkgKFzE85uy7Ho","lore_tm_v1_WnT4WB4JnfSENY-whkzJakaRJ8IqcYWsHesAEz9VT10","lore_tm_v1_H9Kast3gndsMfXiVT6a9wPMT2QDHkH3TimjB8xtI0rs","lore_tm_v1_f6Olk85cN6TM6uJ8LtywCnG5qAiQ4jEqHFHSbonq6Ok","lore_tm_v1_G70y4jOfYi0i3gYPsg1vDigsx_8FmMZHbx2AuubC2Ro","lore_tm_v1_okhBFymhrEZfjjS3G0QLNwlT6AIJCvJnqRN57uKUVqE","lore_tm_v1_9hBjO-rJK9bB76JLZNA6YMC4a1kvw6kU5ETHaWl9c_k","lore_tm_v1_HMnfnyrNjPunsv-7FML_56qtIXCOjzf1WQGLYtpkh00","lore_tm_v1_Ef2V3VehOfWs2wOzCBh1GD_CUsJyDHPcBR1Q5Yk6XUE","lore_tm_v1_oZNgo-cLG2Yg592bDdLlpdBMQzg6jZw_tQl2ej0dWeM","lore_tm_v1_1qBxskgY15IL66kfFfM2_VQGJtjuksP9Z3CyaMJ8dKg","lore_tm_v1_Xa5FGWzZZ3VbZVfL6neaQ_rB6Tbw9h7mH1JhxWQaOFo","lore_tm_v1_Mil2pUeawed6NhH0I5HEqpx1NCZPissevU1uroZfIP0","lore_tm_v1_wZxXxkaeK-iuix7ebhOkKb-vvUxQzG2b7lLG-hKmZnA","lore_tm_v1_SHI6BfbvUEhBPhw7vSLIzWJ7VfW3pUN4qMUu__BoxRs","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","lore_tm_v1_AKXKf6OmR3tQ9DSkZfmlPT5or5iZIzfI0pCMvaM3Ru0","lore_tm_v1_aPKeRTH0CYlOQfLKbtsuc2pBNrtSkMpn8LC_-3EkIb8","lore_tm_v1_SAv_6JxZAJOxW_hrrtkWWBkElUk9njqAa8-gBIrR3LI","lore_tm_v1_iJMeoVJ0ceL6H1jG5_T_Amx-9vgw7BiUZ5AtAQkfPZU","lore_tm_v1_3mNa7H8mR0hLvEcXnGvyhR4AT2rqeSq7wXufvjlJb0M","lore_tm_v1_U63oPqjrPuXt6kcjIw2aFw5UHCt_DQNbRpw0X2Na1GE","lore_tm_v1_GeOWAVGvOfz-1OMQkQevi-u931XXCAVvlJYNRyaCbS0","lore_tm_v1_CAEHEqcdLKcffI8fV_EEBUteSjVaZCor5-iky5n_xPw","lore_tm_v1_biWsWiVHua2xyHT2RgQplh_4S4W-aJrDkzoagyh8Fk4","lore_tm_v1_b3OfqYF2Uui0CXuDPiSy7QV5Hn0ApwmSWrq2uoRNAEg","lore_tm_v1_Tlherg9VUtdTZAwHs3YsCKI4gAbYqKGFxDJtrm8XAiY","lore_tm_v1_rilt7c1pl1KewjCiJqAV1HW7Kfy0PM-8nt_Mh7EJAJI","lore_tm_v1_Md9MbTZqvtWdBqYjwD_RwyNjCzhae-1jVkAWNwabB3M","lore_tm_v1__ROiM3iuLKAyOmawCSx0CBtrFTVPkfCl9HAU7t8dQNI","lore_tm_v1_PLkUCfXpVsVI5R5CZFBoxilEx9zVLXpuhXBCx91hHf0","lore_tm_v1_niXtgqBYSTipqzvWgv1dCWnIxvf30vtZEaPJKSidcNM","lore_tm_v1_IvOHbEU6w0TOPWI1vx2WeDbpUudnT8sd5K_rj10dhv0","lore_tm_v1_Ve-vLWANMQ27sZyJz17eJ1wwVXVlqMOuK70qUJ1m9BQ","lore_tm_v1_YQ9MTOUyoM5ZrJ_f4S9OLWu6u8Vy0o8m7D1P3mqey30","lore_tm_v1_yoc438RSkrINg3WMdS-8Gs6h4fhJrViTI2uYtIsxSRY","lore_tm_v1_xSC5eCUeelQY3m75UgIMZOxChd8gXsQOTmIHjWxXAk4","lore_tm_v1_6n0ZYu6Xnq24ttunZ64ZCBcfPNtVeHQWOiUop-FeOuc","lore_tm_v1_m7mg85AjWdfvDg2Jyn6NW1cquUrjSehLtrUiQ1gnvnM","lore_tm_v1_GlFSzkDR5QDx0ZY2OP05sla56GplTFpXoX0KjP-HU2w","lore_tm_v1_VlEmBAofBDdX2eLRhZTUeiTdL5dUPyaSJCSKHfTTGSs","lore_tm_v1_AhGvKI-l-C_wDQcfxb7h_LfbP_mmE30_uSUyRJx2Nhc","lore_tm_v1_w7GFMGQuT9OJ1RqGPeyAZy2mIlCElDvl340ytNW-m1M","lore_tm_v1_nlmu0H_IAAXg949rwIWE3OU-9B_dIvvRFJ7cuv_JIzk","lore_tm_v1_J0igZykNFEpt9we3N56f3f0GNIQU7f6xgxfQ9V0-x4c","lore_tm_v1_Y-zLXBY9hnm5_IcMY3yE6nwXI4M1MQTtDaw_N4tLlzk","lore_tm_v1_VJQCR3g-QNRft4qotyiAsZ-5ZyRxV-QQZJBg3Wm9gM0","lore_tm_v1_4RF2lrnHOiqQGU13FS2oTOaQPsKGK0Knh3o4DQ9W1ck","lore_tm_v1_g9ArUZjsXQatTFPuAVDpN85apxtS0HaFFFi3AMxLFY4","lore_tm_v1_w6Gtw4EpPGJ6i6rQ6yxfqMFIUn_s7ToTZJujPzxA7Os","lore_tm_v1_h-ZHvps2PAfHdMGuFrmAElZOnZ8gLhbK_nF_eiXp_AA","lore_tm_v1_DMfeyK3abdhoTywUjJ6PeNWhwjc5sw-TDjKfB1rUcW4","lore_tm_v1_R7jXE0lkA9-OBpRqqhG3OYO5VzW-SUraNAsdEddxdXM"]
/home/byk/Code/opencode.continue,SessionPrompt,SessionExecution.active() is runtime-only, reports foreground drains owned by the current process, and is empty after restart.SessionTable, SessionMessageTable, SessionInputTable, and SessionContextEpochTable contain no durable active-run identity, provider-turn status, recovery claim, recovery epoch, recovery timestamp, or clustered execution owner.session.resume(sessionID) behavior already repairs stale projected tool work:
Tool execution interrupted,wake(sessionID) must not infer that ambiguous provider work is safe to retry. The V2 spec explicitly defers post-crash continuation recovery until provider-dispatch ambiguity, continuation, queued-input handling, retry/abandon policy, visibility, startup discovery, and ownership fencing are jointly modeled.packages/core/src/session/projector.tspackages/core/src/session/compaction.tspackages/core/src/session/todo.tspackages/core/src/session/store.tspackages/core/src/session/sql.tspackages/core/src/session/schema.tspackages/core/src/session/run-coordinator.tspackages/core/src/session/revert.tspackages/core/src/session/prompt.tspackages/core/src/session/message.tspackages/core/src/session/message-updater.tspackages/core/src/session/input.tspackages/core/src/session/info.tspackages/core/src/session/history.tspackages/core/src/session/execution.tspackages/core/src/session/event.tspackages/core/src/session/error.tspackages/core/src/session/context-epoch.tspackages/core/src/session/execution/local.tspackages/core/src/session/runner/index.tspackages/core/src/session/runner/llm.tspackages/core/src/session/runner/model.tspackages/core/src/session/runner/max-steps.tspackages/core/src/session/runner/to-llm-message.tspackages/core/src/session/runner/publish-llm-event.tspackages/schema/src/session.tspackages/schema/src/session-id.tspackages/schema/src/session-event.tspackages/schema/src/session-message.tspackages/schema/src/session-input.tspackages/schema/src/session-delivery.tspackages/schema/src/session-status-event.tspackages/schema/src/event.tspackages/schema/src/event-manifest.tspackages/schema/src/durable-event-manifest.tspackages/schema/src/prompt.tspackages/protocol/src/groups/session.tspackages/protocol/src/groups/message.tspackages/core/src/event/sql.tspackages/core/src/database/database.tspackages/core/src/database/migration.tspackages/core/src/database/migration.gen.tspackages/core/src/database/schema.gen.tspackages/core/script/migration.tspackages/server/src/routes.tspackages/cli/src/commands/handlers/serve.tspackages/core/src/effect/app-node.tspackages/core/src/effect/app-node-builder.tspackages/core/src/location-services.tsspecs/v2/session.mdspecs/v2/schema-changelog.mdspecs/v2/todo.md.opencode/references/effect-smolpackages/core/test/session-runner.test.tspackages/core/test/session-projector.test.tspackages/core/test/session-compaction.test.tspackages/core/test/session-runner-tool-registry.test.tspackages/core/test/session-runner-recorded.test.tspackages/core/test/session-prompt.test.tspackages/core/test/session-history.test.tspackages/core/test/session-create.test.tspackages/core/test/move-session.test.tspackages/core/test/session-tool-progress.test.tspackages/core/test/session-todo.test.tspackages/core/test/session-runner-tool-events.test.tspackages/core/test/session-runner-model.test.tspackages/core/test/session-runner-message.test.tspackages/core/test/session-run-coordinator.test.tspackages/core/test/database-migration.test.tspackages/core/test/event.test.tsSessionPrompt, SessionPrompt.loop(...), or any legacy/in-memory tool loop.SessionV2.prompt(...) admits one durable session_input row before advisory SessionExecution.wake(sessionID); resume: false means admit-only.SessionExecution.wake(sessionID).specs/v2/todo.md explicitly rejects inventing an enclosing execution identity solely to group continuation-recovery state.Tool execution interrupted. Hosted/provider-executed tool settlement must preserve provider metadata and represent the unknown/interrupted result without calling the tool again.assistantMessageID; stale incomplete assistants must not be revived when a newer turn exists.continue equivalent, with an idempotency mechanism tied to the durable recovery claim/epoch rather than merely checking prompt text.@opencode-ai/schema; persistence and recovery behavior belong in Core; process-start composition belongs in Server/CLI. Client runtime may depend on Schema and Protocol, never Core or Server. sdk-next composes Client/Core/Server.SessionRunner, model resolution, tool registry, permissions, and filesystem stay Location-scoped. SessionExecution and SessionStore remain process-global and Session-ID-based; no layer may take a Session ID.llm.stream(request) per provider turn, projected history reloaded before durable continuation, and safe-boundary delivery semantics preserved.wake() is advisory; startup recovery needs an explicit durable policy and claim before waking.SessionExecution.active() for discovery: Rejected because it is process-local and empty after restart.specs/v2/session.md and specs/v2/todo.md.owner_id: Rejected by repository policy requiring replay-owner claims to remain separate from Session-execution ownership.effect-smol usage against .opencode/references/effect-smol and nearby code, not memory.Effect.gen(function* () { ... }) and Effect.fn("Name") or Effect.fnUntraced(...) where appropriate.testEffect(...) from packages/opencode/test/lib/effect.ts, it.live(...) for live platform behavior, and explicit layers/scoped fixtures.package.json intentionally fails with "test": "echo 'do not run tests from root' && exit 1"; see root AGENTS.md:141-145.bun typecheck from the package directory, never direct tsc; see root AGENTS.md:147-149.await import(...).then(...) or (await import(...)).value().snake_case.any, unchecked casts, non-null assertions, unnecessary try/catch, unnecessary destructuring/reassignment, and else when early return suffices.1.3.14, Effect 4.0.0-beta.83, Drizzle ORM 1.0.0-rc.2, TypeScript 5.8.2.packages/core/package.json: "test": "bun test --only-failures", "typecheck": "tsgo --noEmit".packages/server/package.json: "typecheck": "tsgo --noEmit".packages/schema/src/session.ts
Session.Info contains metadata, placement, accounting, timestamps, and revert state only.Session.Info is currently annotated "SessionV2.Info" at line 44, which conflicts with the Schema rule that current permanent contracts remove V2.Session.ListAnchor at lines 46-51 contains id, finite time, and direction "previous" | "next".packages/schema/src/session-message.ts
msg_.AgentSwitched, ModelSwitched, User, Synthetic, System, Shell, Assistant, Compaction.AssistantText | AssistantReasoning | AssistantTool.ToolStatePending | ToolStateRunning | ToolStateCompleted | ToolStateError.packages/schema/src/session-input.ts
SessionInput.Admitted: admittedSeq, message id, sessionID, prompt, delivery, timeCreated, optional promotedSeq.packages/core/src/session/sql.ts
SessionTable, SessionMessageTable, SessionInputTable, SessionContextEpochTable.MessageTable, PartTable, TodoTable.SessionTable has no durable recovery/ownership columns.SessionMessageTable: primary key id, session_id, type, per-session seq, timestamps, JSON data; unique (session_id, seq).SessionInputTable: id, session_id, JSON prompt, delivery, admitted_seq, nullable promoted_seq, time_created; unique per-session admitted/promoted sequences.SessionContextEpochTable: one row per Session with baseline, JSON snapshot, and baseline_seq.packages/core/src/event/sql.ts
event_sequence(aggregate_id PRIMARY KEY, seq NOT NULL, owner_id NULL).event(id PRIMARY KEY, aggregate_id FK CASCADE, seq, type, data).(aggregate_id, seq).owner_id belongs to EventV2 replay ownership and must not be reused for Session execution recovery.packages/schema/src/session-event.ts:47 declares the V2 durable Session event version as 2.Event.versionedType(type, version) is at packages/schema/src/event.ts:94; durable-key construction is around line 102.Step.Started records assistantMessageID, agent, model, and optional snapshot.Step.Ended records finish, cost, token accounting, optional snapshot/files.Step.Failed records UnknownError.Step.Ended and Step.Failed use synchronized durable version 2, because settlement is bound to an explicit assistant message ID.Tool.Called: tool name, decoded input, provider execution metadata.Tool.Progress: durable bounded running checkpoint with structured and content.Tool.Success: structured/content output, optional paths/result, provider metadata.Tool.Failed: UnknownError, optional result, provider metadata.Text.DeltaReasoning.DeltaTool.Input.DeltaCompaction.Delta
Their replayable boundaries are the corresponding Ended events.SessionEvent.DurableDefinitions was reported as containing 29 events; the observed ordered list was:
AgentSwitchedModelSwitchedMovedPromptedPromptAdmittedContextUpdatedSyntheticShell.StartedShell.EndedStep.StartedStep.EndedStep.FailedText.StartedText.EndedTool.Input.StartedTool.Input.EndedTool.CalledTool.ProgressTool.SuccessTool.FailedReasoning.StartedReasoning.EndedRetriedCompaction.StartedCompaction.EndedRevertEvent.StagedRevertEvent.ClearedRevertEvent.Committed
The source observation’s count and displayed enumeration differ and should be rechecked before relying on a manifest delta.packages/schema/src/durable-event-manifest.ts combines durable V1 definitions and all current SessionEvent.DurableDefinitions.packages/schema/test/event-manifest.test.ts:
EventManifest.ServerDefinitions.length === 55EventManifest.Definitions.length === 85EventManifest.Latest.size === 85EventManifest.Durable.size === 32"session.next.step.ended.1" absent"session.next.step.ended.2" maps to SessionEvent.Step.Ended.packages/core/src/session/input.ts operations:
findadmitprojectAdmittedprojectPromptedhasPendingequivalentpromoteSteerspromoteNextQueuedSessionInput.admit is idempotent by SessionMessage.ID. It publishes PromptAdmitted only if absent and derives admittedSeq from the durable event sequence.projectAdmitted rejects message/input lifecycle collisions and inserts with onConflictDoNothing().projectPrompted atomically changes promoted_seq only where null, validates projection identity, and can reconstruct a missing admitted row.packages/core/src/session/execution.ts:
activeresume(sessionID)wake(sessionID)interrupt(sessionID)SessionExecution.Service is global and unbound; noopLayer supports admit-only callers.packages/core/src/session/execution/local.ts:
SessionStore,LocationServiceMap.get(session.location) only when draining,runner.run({ sessionID, force }),Session not found: ${sessionID} when absent,Failed to drain Session.packages/core/src/session/run-coordinator.ts:
pendingWake,Effect.uninterruptibleMask for run(key).activeShellIndex(callID)updateOwnedAssistant(assistantMessageID, ...)latestText(...)latestTool(...)updateShell."session.next.moved": () => Effect.void"session.next.revert.staged": () => Effect.void"updates only the newest incomplete assistant projection" verifies only msg_assistant_2 receives completion."does not revive a stale incomplete assistant projection" leaves msg_assistant_stale untouched and applies new text to the newer completed assistant.In packages/core/test/session-runner.test.ts:
"Recover with this" admitted while "Start working" provider stream is gated; after streamFailure, a second request contains both user texts in order.call-interrupted, tool echo, input { text: "stale" }, provider { executed: false };session.resume(sessionID) sends roles ["user", "assistant", "tool"];Tool execution interrupted.web_search recovery:
call-hosted-interrupted,itemId,["user", "assistant"],call-pending-interrupted is recovered as an assistant tool error; request roles are ["user", "assistant", "tool"]."Wait in queue" after it was admitted with resume: false.new Error("fail after prompt promotion"); a later wake still produces "Recover promoted input"."transitions streamed raw tool input to parsed called input" currently ends with hosted tool state { status: "error", input: { query: "hello" } }."Duplicate text start: text-1""Tool input delta before start: call-1"fragmentKinds entry there are three regressions:
These tests show the runner can reconcile stale projections once explicitly invoked, but they do not provide startup scanning, ownership claiming, exactly-once continuation admission, or concurrent-process coverage.
SessionHistory.load() loads baseline sequence and latest compaction concurrently, then decodes ordered message rows.loadForRunner() / entriesForRunner() select projected history after the active compaction and baseline.MessageDecodeError with Session and message IDs.toLLMMessages:
ToolOutput.toResultValue rejects them.packages/core/src/session/compaction.ts:
DEFAULT_BUFFER = 20_000DEFAULT_KEEP_TOKENS = 8_000TOOL_OUTPUT_MAX_CHARS = 2_000SUMMARY_OUTPUT_TOKENS = 4_096Compaction.Started, streams a no-tool summary, and publishes Compaction.Ended only for successful nonempty output.[Synthetic context]: ${message.text}.TurnTransitionError includes:
{ _tag: "ContinueAfterCompaction"; step: number }{ _tag: "ContinueAfterOverflowCompaction"; step: number }packages/server/src/routes.ts builds application services from:
Database.nodeEventV2.nodeToolOutputStore.cleanupNodeSessionV2.nodePermissionSaved.nodePtyTicket.nodeCredential.nodePtyEnvironment.nodeLocationServiceMap.node[SessionExecution.node, SessionExecutionLocal.node] through AppNodeBuilder.build.packages/cli/src/commands/handlers/serve.ts:
Runtime.handler(Commands.commands.serve, Effect.fn("cli.serve")(...))listen() probes ports 4096 through 65_535 when no explicit port is supplied.bind() serves createRoutes(password) and builds Credential.node plus PermissionSaved.node.AppNodeBuilder.build(root, replacements) auto-builds a LocationServiceMap when an unbound node is present and no replacement exists; replacements match by node name.makeGlobalNode and makeLocationNode are defined from LayerNode.tags({ location: ["global"], global: [] }).buildLocationServiceMap():
Location.Ref,Location.node and Location.boundNode(ref),"booting location services",idleTimeToLive: "60 minutes".Location.nodePolicy.nodeConfig.nodeAgentV2.nodeCommandV2.nodeReference.nodeIntegration.nodeCatalog.nodeAISDK.nodePluginV2.nodePluginInternal.nodeProjectCopy.nodeProjectCopy.refreshNodeFileSystemSearch.nodeFileSystem.nodeWatcher.nodePty.nodeSkillV2.nodeSystemContextRegistry.nodeSystemContextBuiltIns.nodeLocationMutation.nodeFileMutation.nodePermissionV2.nodeToolOutputStore.nodeToolRegistry.nodeToolRegistry.toolsNodeImage.nodeSkillGuidance.nodeReferenceGuidance.nodeSessionTodo.nodeQuestionV2.nodeReadToolFileSystem.nodeBuiltInTools.nodeSessionRunnerModel.nodeSnapshot.nodeSessionRunnerLLM.nodepackages/core/src/database/database.ts configures SQLite with:
PRAGMA journal_mode = WALPRAGMA synchronous = NORMALPRAGMA busy_timeout = 5000PRAGMA cache_size = -64000PRAGMA foreign_keys = ONPRAGMA wal_checkpoint(PASSIVE)DatabaseMigration.apply() is serialized only by an in-process Semaphore.makeUnsafe(1); cross-process migration claiming is a known deferred hardening issue.session use applyOnly; nonempty databases without session fail with Database is not empty and has no session table.packages/core/script/migration.ts, 196 lines.
--check validates snapshot, schema.gen.ts, and migration.gen.ts.Core schema has ungenerated database migrations. Run \bun script/migration.ts` from packages/core.`Current database schema is stale. Run \bun script/migration.ts` from packages/core.`Database migration registry is stale. Run \bun script/migration.ts` from packages/core.`20260603141458_session_input_inbox20260604172448_event_sourced_session_input20260622170816_reset_v2_session_state20260622202450_simplify_session_inputpackages/core/src/database/migration.gen.ts imports 38 migrations in order:
20260127222353_familiar_lady_ursula20260211171708_add_project_commands20260213144116_wakeful_the_professor20260225215848_workspace20260227213759_add_session_workspace_id20260228203230_blue_harpoon20260303231226_add_workspace_fields20260309230000_move_org_to_state20260312043431_session_message_cursor20260323234822_events20260410174513_workspace-name20260413175956_chief_energizer20260423070820_add_icon_url_override20260427172553_slow_nightmare20260428004200_add_session_path20260501142318_next_venus20260504145000_add_sync_owner20260507164347_add_workspace_time20260510033149_session_usage20260511000411_data_migration_state20260511173437_session-metadata20260601010001_normalize_storage_paths20260601202201_amazing_prowler20260602002951_lowly_union_jack20260602182828_add_project_directories20260603001617_session_message_projection_indexes20260603040000_session_message_projection_order20260603141458_session_input_inbox20260603160727_jittery_ezekiel_stane20260604172448_event_sourced_session_input20260605003541_add_session_context_snapshot20260605042240_add_context_epoch_agent20260611035744_credential20260611192811_lush_chimera20260612174303_project_dir_strategy20260622142730_simplify_session_context_epoch20260622170816_reset_v2_session_state20260622202450_simplify_session_input@opencode-ai/schema owns browser-safe wire/storage contracts; runtime services and side effects remain in owning domain packages.V1.optional(...) to omit undefined.Schema.Any; use Schema.Json or Schema.Unknown.Schema.Any, stable/unique identifiers, facade identity, and exclusion of V1-only events from current manifests.specs/v2/todo.md says future recovery must jointly model:
SessionStatusEvent.Info currently has only:
{ type: "idle" }{ type: "retry", attempt, message, action?, next }{ type: "busy" }
It has no durable startup-recovery/unknown-outcome state.SessionStatusEvent.Status is event type "session.status"; deprecated Idle is "session.idle".08:53
/home/byk/Code/opencode.SessionPrompt, atomic durable claiming, and preserved layering.08:54-08:55
AGENTS.md guidance collected.08:56-08:58
08:58-09:00
09:01-09:04
09:05-09:07
09:08-09:09
09:14-09:16
09:25
09:27-09:31
2.09:39-09:48
09:59-10:03
AppNodeBuilder and Location service map construction inspected.10:12-10:20
10:28
10:29-10:31
specs/v2/schema-changelog.md source lines identified:
2,Tool execution interrupted.