Dashboard › opencode › Distillation
d87ae905-00cb-4f9b-9a64-5f5ad2625a23["lore_tm_v1_lEXyQWlRaugHUAj8pz0ab_sL7Na3IQ0MUfNS9T0BI6o","lore_tm_v1_PBuooGW2RFI_4wFT3T5P-tkA0G1smxBgbx3ltA0PXik","lore_tm_v1_LDn8r-7-GetElqUQzgFJb6dQywZ_WLRxp1YQtpBWqqc","lore_tm_v1_E5qvoYVJkJbAapf--D4koNw5f-KH0ZH3woI1GZccPfw","lore_tm_v1_Fgsg93CD4KYUAIr3Uioe6BblDzDQz_GMC878jOcCALE","lore_tm_v1_mggACK_e3KDS8JmYGpaXVU8hOykF01UGSNQuzXRwIBI","lore_tm_v1_0rOlmn5tyJUtFSo6mcDGHi7YXF_fu33unk-5B0pQKaA","lore_tm_v1_6457mTMWoZiGECP6QhS0DUXP4ELliuHXOooApKNGBmA","lore_tm_v1_gl8iBO9wVGeiDvPC23UH30Six8kG8qM7trlBgBOyD60","lore_tm_v1_7IxuyCRqHzRBf1tetFpUvaEeBbxp0DpUTxzoGoY3_sI","lore_tm_v1_nBoKZ-HlrEgNMe4jM3nkfUNFZVXkjiVuzBuU9BP0c94","lore_tm_v1_sz4-T5amnraCApQnKH5eqek8g_Ef7IMi6BQ4ZRWE5zQ"]
Date: Sep 15, 2026
/home/byk/Code/opencode, writing code and tests while preserving unrelated files.git diff --check.needsContinuation is only process-local while Step.Ended writes phase safe, so a crash before the next Step loses the required continuation.Compaction.Ended, phase safe is committed before the process-local transition starts the rebuilt Step, creating the same durable-continuation gap.Step.Ended and Compaction.Ended.continue through a durable recovery/outbox event and then wake exactly that input.continue if it provides a clean state machine.session_recovery identity/nullability/schema as needed.Step.Ended with a tool result and after a committed Compaction.Ended; each must prove restart admits/redrives exactly one continuation and never alters the settled result or summary.Prompted replay must deterministically clear the matching recovery wake_pending because local EventV2 commit hooks do not replay.Prompted projector transaction, with live commit logic adjusted so it does not fail after the projector has already cleared the row.Step.Recovered followed by continuation Prompted, then projection rebuilding, proving the recovery outbox is settled and later ordinary work runs.step-finish, to atomically publish Step.Interrupted or an equivalent durable cancellation settlement and clear the exact execution claim.unknown for startup recovery and must never synthesize continue.SessionInput.admit to verify retry equivalence before setting wake_pending on an existing row.resume:false and the conflicting retry uses default resume; recovery/redrive must prove no wake occurs.session_recovery relationships to be validated at the owning recovery boundary: deterministic continuation ID; continuation in the same Session; continuation still pending; canonical queue/continue payload; and optional assistant/recovery target belonging to the same Session where applicable.session_recovery rows to be quarantined or permanently settled so bounded scans progress and never wake or fail the target repeatedly.recovery_error column to session_recovery, required quarantined rows to be filtered from pending scans, and required deterministic bounded ordering.continue prompt and existing user-visible interruption text.packages/core/src/session/sql.ts schema showed SessionRecoveryTable.assistant_message_id as non-null, primary key (session_id, assistant_message_id), unique indexes on execution_id and continuation_message_id, and wake_pending defaulting to true.packages/core/src/session/sql.ts schema showed SessionExecutionTable.phase limited to "ready" | "safe" | "unknown" with check constraint session_execution_phase_check; SessionExecutionTable already has nullable recovery_error.packages/core/src/session/recovery.ts uses BATCH_SIZE = 100, scans expired SessionExecutionTable rows with null recovery_error, orders by time_created then id, and claims them by replacing owner_id and extending expires_at.packages/core/src/session/recovery.ts clears claims immediately for phase safe or when assistant_message_id is not the latest assistant; otherwise it publishes SessionEvent.Step.Recovered and clears the exact claim through an EventV2 commit hook.SessionRecoveryTable rows with wake_pending=true, orders by time_created then execution_id, checks only that continuation_message_id === continuation(execution_id), and otherwise merely logs "Invalid recovery continuation identity" without quarantining the row.SessionInputTable rows where wake_pending=true and promoted_seq IS NULL, grouped by Session and ordered by earliest time_created.SessionInput.promoteExact() in packages/core/src/session/input.ts selects an exact pending queue input by id and session_id, dies with Pending recovery input not found: ${messageID} when absent, and publishes it with a caller-supplied commit effect.Prompted projector in packages/core/src/session/projector.ts calls SessionInput.projectPrompted(...) and then run(db, event), but does not settle matching SessionRecoveryTable.wake_pending.Step.Recovered projector validates a supplied assistant as the latest assistant, runs the recovery event, admits deterministic continuation ID continuation(executionID) with Prompt.make({ text: "continue" }) and delivery "queue", then inserts SessionRecoveryTable with wake_pending:true.packages/core/src/session/recovery-id.ts defines recovery message IDs as the assistant ID when available or msg_recovery_${executionID}, and continuation IDs as msg_recovery_continue_${executionID}.SessionEvent.Step.Recovered schema in packages/schema/src/session-event.ts has optional assistantMessageID and phase restricted to "ready" | "unknown".packages/core/src/session/runner/publish-llm-event.ts records provider step-finish by flushing output, setting assistantActive=false, rejecting duplicate step finishes, and storing { finish: event.reason, tokens: tokens(event.usage) }; tool-result handling separately publishes Tool.Success or Tool.Failed.