Dashboard › opencode › Distillation
f15a7673-31f6-40e7-baf7-3d5b8a0b3844["lore_tm_v1_c6su6DcQwhEsynsKp1kMrapeXzUR5tWboEZbS7O57wE","lore_tm_v1_l24M8pGnbavpYoII-ORcbapIXRY_Pa8HyW9VVkrX2m0","lore_tm_v1_gy8_XKUCJnVPzI5k8MrtsU7NQvZLxP2aVilVAfNgcOs","lore_tm_v1_Dy17Eypw4FUv9rkwhFZwpzAMeY2eNvv3UYa4U3tvV9k","lore_tm_v1_qCR6lDln6ioNLeZGXLubJOuuLJaQz8U6SuBOCYgJxeo","lore_tm_v1_qAD6YLCuRteTBW8Z8PvIz7lsaEjd_Kxg_gRqjTIs2C8","lore_tm_v1_YMdowqT9AjZKoR8luY6ytJLtT_bn16IaKbZBwtk3E2A","lore_tm_v1_kPVVGZ8lCLhS2-QLotmP4deMI6a1GLFEHFXyWaBFClI","lore_tm_v1_MRmigMO2K8xs6E24pS_8Jqv7muDFItKJCdnqXlLH3iI","lore_tm_v1_CRtFRdHFe4T2EOHgfRq0wHztz0Hk6LeHyYHmfQ8nksQ","lore_tm_v1_bUWebnWcUx1nj0p0L2cCwxfBbxlt0-goOgfyUSWH__c","lore_tm_v1_HRDRzo-QA-QC5IlPd8AyoOkWopZ8Pg1IRXg3XT9soeI","lore_tm_v1_SG_YXZ-OxWQkr3SpOErMMX86k097hTpgRfJvZzMyjHU","lore_tm_v1_T_HJtM8hNwJBLp923Hfx6s-PJIh-7FfhviCoWiT_YBs","lore_tm_v1_Rg9dNPz6wDKaGNq6-WOO8TTUmj24jRRm5cst6mcqGHY","lore_tm_v1_TT4hQ22bJO9q5fUC30hg-m5OVHedO5SouHZuh1VDTjc","lore_tm_v1_J14B4j25DGRQBy9KGRWULbDc90I8_sQEo7jQ0U4vCkQ","lore_tm_v1_dekElwlZPKCEQZihxtT4jVPeFKN8vzVQVZW6fA_Unpw"]
Date: Sep 16, 2026
packages/schema/src/event-manifest.ts and packages/schema/src/durable-event-manifest.ts.packages/schema/src/session-event.ts defines "session.next.step.recovered" and includes Step.Recovered in both DurableDefinitions (line 499) and Definitions (line 533).packages/schema/src/session-event.ts:484-562 defines durable session events as Schema.Union(DurableDefinitions, { mode: "oneOf" }), transformed with Schema.toTaggedUnion("type") and annotated as "SessionDurableEvent"; all session events use the corresponding union over Definitions. Delta events Text.Delta, Reasoning.Delta, Tool.Input.Delta, and Compaction.Delta occur only in Definitions, not DurableDefinitions.packages/sdk/js/src/v2/gen/types.gen.ts contains 15 recovery/execution-related matches, including EventSessionNextStepRecovered, SyncEventSessionNextStepRecovered, SessionNextStepRecovered, and optional requestExecution?: boolean fields.SyncEventSessionNextStepRecovered in packages/sdk/js/src/v2/gen/types.gen.ts:3602-3618 wraps a "sync" event whose syncEvent.type is "session.next.step.recovered.1" and whose data requires timestamp, sessionID, executionID, and phase; assistantMessageID is optional and generated phase is "ready" | "unknown" | "continue".packages/core/src/session/recovery-id.ts deterministically derives recovery IDs: message(executionID, assistantMessageID?) returns the supplied assistant message ID or SessionMessage.ID.make(\msg_recovery_${executionID}`); continuation(executionID)returnsSessionMessage.ID.make(`msg_recovery_continue_${executionID}`)`.packages/core/src/location-service-map.ts defines Service as a LayerMap.LayerMap<Location.Ref, LocationServices, LocationError> under context key "@opencode/example/LocationServiceMap"; Service.get(ref) unwraps locations.get(ref), and node is LayerNode.unbound(Service, Node.tags.values.global).buildLocationServiceMap(replacements = []) in packages/core/src/location-services.ts:84-112 creates per-Location.Ref service layers with LayerMap.make; it appends [Location.node, Location.boundNode(ref)] before LayerNode.hoist(...) so newly introduced tagged dependencies can be sliced out, compiles the location layer with Layer.fresh, logs "booting location services" with directory and workspaceID, provides the compiled hoisted layer, and uses { idleTimeToLive: "60 minutes" }. locationServiceMapLayer = buildLocationServiceMap() remains temporarily for backwards compatibility.packages/core/src/session/runner/index.ts defines SessionRunner.Interface.run({ sessionID, force, executionID, ownerID, recoveryInputID? }); it drains eligible durable work, while explicit runs perform one provider attempt even with no eligible work. RunError includes LLMError, SessionRunnerModel.Error, MessageDecodeError, ContextSnapshotDecodeError, SystemContext.InitializationBlocked, and ToolOutputStore.Error."never wakes execution when retrying an already promoted prompt"."never arms durable wake for a conflicting execution retry".packages/core/test/session-prompt.test.ts:310-327 verifies an exact retry with resume: true recovers a committed prompt, returns the original message, and calls advisory wake exactly once with [sessionID].packages/core/test/session-prompt.test.ts:330-371 verifies retrying an already promoted prompt with resume: true causes no wake: the promoted input remains promoted_seq: 1, wake_pending: false, while a separate pending input remains promoted_seq: null, wake_pending: false.packages/core/test/session-prompt.test.ts:374-405 verifies execution intent is durably recorded before advisory wake: a default prompt has wake_pending: true and promoted_seq: null, immediately wakes [sessionID], preserves the pending wake through projection replay, and recover() wakes the session again.packages/core/test/session-prompt.test.ts:408-437 verifies replaying historical SessionEvent.PromptAdmitted without execution intent creates an admit-only "steer" input with wake_pending: false and promoted_seq: null; recover() schedules no wake.packages/core/test/session-prompt.test.ts:440-486 verifies an exact resume: true retry upgrades an admit-only prompt into durable execution intent. Two unbounded concurrent retries leave wake_pending: true, produce two advisory wake calls but exactly one version-1 SessionEvent.PromptExecutionRequested; repeated projection replay preserves wake_pending: true, and recovery issues one wake.packages/core/test/session-prompt.test.ts:489-511 verifies reusing one message ID with different prompt text returns Session.PromptConflictError, leaves visible session messages empty, and keeps the admitted count at exactly 1.packages/core/test/session-prompt.test.ts:514-553 verifies a conflicting resume: true retry returns Session.PromptConflictError, leaves wake_pending: false, publishes 0 version-1 SessionEvent.PromptExecutionRequested events, makes no advisory wake, and remains inert after projection replay and recover().packages/core/test/session-prompt.test.ts:556-578 verifies reusing one prompt ID with a different delivery modeβoriginal default/steer versus retry "queue"βreturns Session.PromptConflictError.packages/core/test/session-prompt.test.ts: 1. promoteSteers(..., cutoff) promotes only inputs through the captured admittedSeq; 2. projection replay preserves a pending input with wake_pending: false, no visible messages, and no recovery wake; 3. exact retries of legacy projected "steer" and "queue" prompts return the historical prompt; 4. reuse of a globally unique message ID across sessions is rejected with Session.PromptConflictError; 5. an ID already used by visible SessionEvent.Synthetic history is rejected and not admitted.packages/core/test/session-prompt.test.ts:761-804: omitted resume records the prompt and advisory-wakes [sessionID]; resume: true does the same; resume: false records only and makes no wake. All three cases expect no direct executionCalls.packages/core/test/session-run-coordinator.test.ts:220-242 verifies that interrupting a resumed run after a wake yields an interrupt-only failure, empties coordinator.active, and performs exactly 1 drain run.runs === 2); 2. even when interruption cleanup dies with Error("cleanup defect"), cleanup finalization allows a queued wake to start and leaves no active runs (runs === 2); 3. a resume registered during interruption cleanup starts afterward with force sequence [false, true]; 4. a wake racing with first-run failure starts exactly one follow-up while the joined resumed call still receives the original Error("failed") (runs === 2).packages/opencode/src/server/routes/instance/httpapi/middleware/workspace-routing.ts exposes optional query fields directory and workspace via WorkspaceRoutingQueryFields/WorkspaceRoutingQuery; endpoint schemas must spread these fields because the current effect-smol HttpApiMiddleware cannot declare query parameters.RequestPlan variants InvalidWorkspace, MissingWorkspace, Local, and Remote. WorkspaceRouteContext supplies directory and optional workspaceID; WorkspaceRoutingMiddleware provides that context and requires Session.Service.workspace-routing.ts: /api/ routes validate workspace with WorkspaceV2.ID, returning a JSON InvalidRequestError with status 400, kind "Query", and field "workspace" when invalid; missing workspaces return plain text "Workspace not found: ${id}" with status 500; local directory precedence is session directory, then URL directory, then x-opencode-directory, then process.cwd().Workspace.Service.isSyncing(workspace.id); a broken sync connection returns status 503. WebSocket upgrades use HttpApiProxy.websocket, other requests use HttpApiProxy.http, and response fence headers are parsed with Fence.parse; a fence wait failure is converted to status 503.packages/schema/test/event-manifest.test.ts asserts the public manifest has exactly 61 ServerDefinitions, 91 total Definitions, 91 entries in Latest, and 38 entries in Durable. It verifies canonical SessionEvent/WorkspaceEvent identities, excludes "ide.installed" from Latest, excludes "session.next.step.ended.1" from Durable, maps "session.next.step.ended.2" to SessionEvent.Step.Ended, and maps "session.next.prompt.execution_requested.1" to SessionEvent.PromptExecutionRequested.packages/core/schema.json contains generated definitions for session_execution, session_recovery, wake_pending, wake_attempts, their foreign keys and primary keys, indexes session_execution_session_idx, session_execution_owner_idx, session_input_wake_pending_promoted_attempts_time_created_id_idx, session_recovery_continuation_message_idx, session_recovery_wake_pending_error_attempts_created_execution_idx, and check constraint session_execution_phase_check.packages/sdk/openapi.json contains recovery-related schemas in four generated surfaces, including optional requestExecution, unversioned "session.next.step.recovered", versioned "session.next.step.recovered.1", executionID, and required fields ["timestamp", "sessionID", "executionID", "phase"].