Dashboard › opencode › Distillation
4da25916-5f4e-46e2-a696-53a03c72b223["lore_tm_v1_MV9GUIHbZreboLSaFZ6NPxIsTg1oS8rJDLFFCEeBrzc","lore_tm_v1_hib-a9zc6dqI5QxvULRiRHWCL5kLqg-emA8FlpAIeD4","lore_tm_v1_NQylbsBmk0CFIX6JiF3FcuTSinDnKJSvIF-Ui9Mmtg0","lore_tm_v1_UEasRZhBFFgKSEJWxr5fCQn9wlDOzu5pKAbhX2SbLUQ","lore_tm_v1_0zqA2ZKhrtz7CnXxkySJjLgD7BG3Ph1nTEDUrD6BO3k","lore_tm_v1_RSOTLnzm8hO_kfqq27SV9036QhgTytqKQBBd5xSvCQM"]
Date: Sep 16, 2026
/tmp/opencode/session-recovery-v7-check/packages/sdk/openapi.json found 3 schemas: SessionNextPromptAdmitted at line 28545, SessionNextStepInterrupted at line 29120, and SessionNextStepRecovered at line 29178./tmp/opencode/session-recovery-v7-check/packages/sdk/openapi.json lines 29120-29176 define SessionNextStepInterrupted: event id matches ^evt_; type is enum ["session.next.step.interrupted"]; optional durable requires aggregateID, seq, and version; location references #/components/schemas/LocationRef; data requires numeric timestamp, sessionID matching ^ses, assistantMessageID matching ^msg_, and error referencing #/components/schemas/SessionErrorUnknown; both event and data reject additional properties./tmp/opencode/session-recovery-v7-check/packages/sdk/openapi.json lines 29178-29238 define SessionNextStepRecovered: event id matches ^evt_; type is enum ["session.next.step.recovered"]; optional durable requires aggregateID, seq, and version; location references #/components/schemas/LocationRef; data properties are numeric timestamp, sessionID matching ^ses, string executionID, optional assistantMessageID matching ^msg_, and phase enum ["ready", "unknown", "continue"]; required data fields are ["timestamp", "sessionID", "executionID", "phase"]; both event and data reject additional properties./tmp/opencode/session-recovery-final-v8.patch SHA-256 is 446412b56ac31b2a60f98765b5f14955a771f6074ebeb9309f603a0ceefad1bc; /home/byk/Code/opencode/packages/opencode/dist/server/opencode-server SHA-256 is f4f0bd585d33bd47114b2d8d54082c2b061380771c808e909223350e62c8c72f; base commit is ab9408c81cc9916177641ae8e9f08624fc27b5b9; verification found 33 patch entries and 33 applied paths, a clean index, and exact old/new blob matches./tmp/opencode/session-recovery-final-v8.patch changes createLLMEventPublisher in publish-llm-event.ts: failAssistant publishes SessionEvent.Step.Failed through publishEvent using { commit: input.eventCommit }.commit, then sets assistantActive = false and assistantFailed = true; direct events.publish usage is removed for this path./tmp/opencode/session-recovery-final-v8.patch adds interruptAssistant(message: string, commit: () => Effect.Effect<void> = input.eventCommit): it returns if assistantFailed, flushes, starts or obtains the assistant, publishes SessionEvent.Step.Interrupted with sessionID, timestamp, assistantMessageID, and { type: "unknown", message }, uses the supplied commit, then sets assistantActive = false and assistantFailed = true; interruptAssistant is added to the publisherβs returned interface./tmp/opencode/session-recovery-final-v8.patch routes SessionEvent.Tool.Failed, SessionEvent.Text.Started, SessionEvent.Text.Delta, SessionEvent.Reasoning.Started, SessionEvent.Reasoning.Delta, SessionEvent.Tool.Input.Delta, SessionEvent.Tool.Called, and SessionEvent.Tool.Success through publishEvent instead of direct events.publish./tmp/opencode/session-recovery-final-v8.patch changes publication-state ordering: tool.settled is set only after SessionEvent.Tool.Failed or SessionEvent.Tool.Success publication succeeds; tool.called, tool.providerExecuted, and tool.providerMetadata are updated only after SessionEvent.Tool.Called succeeds; providerFailed is set only after failAssistant(event.message) succeeds. For tool calls, local providerExecuted = event.providerExecuted === true is published before being committed to tool state./tmp/opencode/session-recovery-final-v8.patch changes packages/core/src/session/sql.ts to import sql from drizzle-orm and check from drizzle-orm/sqlite-core, and adds export const MAX_WAKE_ATTEMPTS = Number.MAX_SAFE_INTEGER.ab9408c81cc9916177641ae8e9f08624fc27b5b9, patch SHA-256 446412...ad1bc, and SEA SHA-256 f4f0bd...c72f; all 33 paths and old/new blob hashes matched, reverse application succeeded, and the index remained clean.Step.Interrupted; failed publication leaves the claim unknown for recovery; empty streams create no assistant. References: runner/llm.ts:437-444, publish-llm-event.ts:241-260, and session-runner.test.ts:958-999.publish-llm-event.ts:221-239,262-280,362-457; publication-defect regressions cover Step.Failed and local Tool.Success in session-runner.test.ts:2049-2121.recovery.ts:69-117,143-212; explicit 100-poison/claim-101 regression in session-projector.test.ts:1545-1608.MAX_WAKE_ATTEMPTS to 1, preserve attempts/wake/error CAS predicates, guarantee retry capacity, and rotate work. References: recovery.ts:215-333,335-432; regression session-projector.test.ts:1611-1683.session_wake_attempts_check and session_recovery_wake_attempts_check with identical bounds. References: 20260914170650_session-recovery.ts:9-11,39, schema.gen.ts:212,248, and schema.json:2541-2549.execution/claim.ts:25-66, execution/local.ts:29-99, runner/llm.ts:297-349, and context-epoch.ts:127-194.execution/local.ts:103-132 and run-coordinator.ts:99-125.recovery.ts:119-165, input.ts:321-397,561-598, and projector.ts:399-456.Step.Ended; hosted and local tools settle or become unknown before continuation. References: runner/llm.ts:395-476; regressions session-runner.test.ts:1975-2257.migration.gen.ts:43; populated-predecessor coverage is in database-migration.test.ts:166-228; server startup wires recovery at packages/server/src/routes.ts:27-39 and packages/opencode/.../server.ts:299-304; Schema, generated SDK types, and OpenAPI agree on the new events./home/byk/Code/opencode/packages/opencode/dist/server/opencode-server, or run tests, in accordance with the instruction, and issued the final disposition MERGE.