Dashboard › opencode › Distillation
557735aa-9c29-4c19-8d36-e0c7c5dc9af3["lore_tm_v1_Sr1456GTGwzISyAJqfGs5O6VFw6hB6ih5Da9pf_-smg","lore_tm_v1_shDq7l8FgcFFzLn7Qc3AYseVL6qEt2lbHNHSV70tqXk","lore_tm_v1_fUxBhRLFbTYuI6yDma5y-Pnbl7Ey82XGG2OVjZqJe_w","lore_tm_v1_VPFiMZKAHTWkfENHIs9CSBFD9O6EeWHzdtPd9BCy0a8","lore_tm_v1_k7v3Q1SiWZISyVUAMR9TQl0I8Ky0C1_kVN5ZZJbtxag","lore_tm_v1_3VEKT6xhYkK5wAqb5cm1lTlqyZde4Ez4Eg6d5FSckmA","lore_tm_v1_bylhjtitDCCy0a1pldbElDcvPj_PLI022_ruOU3RuRw","lore_tm_v1_iXS5DDaotCTKuOxtQFZwk8Ug0dghEVProzrG-DxZ2dY","lore_tm_v1_U9Pav4hIoJVmBWMBEGnYVanSZNScbETuWYbIr1yPmmA","lore_tm_v1_7DGrg1iK9Aue-VE-pE6Zkve7hpDREFcu2ZyT6mNDaDI","lore_tm_v1_VD5TVpEcnuHReIU_KcM2X-AdDYE0JRUSnWF8WZThlPc","lore_tm_v1_bGy5Mw_cw9Jlpkj-D7VNWa2avO4kxZ31LG7bUJ-EFps"]
Date: Sep 15, 2026
packages/core/src/session/runner/llm.ts found continuation is process-local: run() loops while needsContinuation, increments step, and recursively transitions after TurnTransitionError; recovered runs execute only the supplied recoveryInputID and then stop.packages/core/src/session/runner/llm.ts currently models Promotion as SessionInput.Delivery | { readonly recoveryInputID: SessionMessage.ID }; recovery promotion uses SessionInput.promoteExact() and a commit effect that clears the matching SessionRecoveryTable.wake_pending, dying with Recovery wake already settled: ${promotion.recoveryInputID} if the projector already settled it.packages/core/src/session/runner/llm.ts currently sets terminalCommit to updateExecution({ phase: "safe", assistant_message_id: null }), confirming successful terminal publication can durably become safe before the next process-local continuation starts.packages/core/src/session/execution/local.ts found each drain inserts one SessionExecutionTable claim with phase "ready", selects the oldest pending recovery by time_created then execution_id, races the runner against lease renewal, and clears the exact claim on successful exit.packages/core/src/session/execution/local.ts clears a failed run’s exact claim only when its current phase is not "unknown"; interrupt-only exits leave cleanup to the interrupt path, which uses owner/execution-scoped SessionExecutionClaim.clear(db, claim) and tolerates SessionExecutionClaim.Lost.packages/core/src/database/migration/20260914170650_session-recovery.ts currently creates session_execution.phase with allowed values 'ready', 'safe', 'unknown'; creates session_recovery.assistant_message_id as NOT NULL; uses primary key (session_id, assistant_message_id); and defines unique indexes on execution_id and continuation_message_id.packages/core/test/session-runner.test.ts and packages/core/test/session-projector.test.ts; session-runner.test.ts contains replaySessionProjection(), recovery redrive tests, multiple projection-rebuild tests, and automatic-compaction tests.packages/core/test/session-runner.test.ts lines 3106–3148 uses a local tool whose execute() dies with new PermissionV2.DeclinedError() after provider step-finish; it expects an interrupt-only failure, exactly 1 provider request, and user-visible tool error text "Tool execution interrupted".packages/core/src/session/projector.ts implements the older-assistant invariant in getCurrentAssistant(): it selects the newest assistant by descending SessionMessageTable.seq and returns it only if incomplete, so stale incomplete assistants behind a newer turn are not resumed.packages/core/src/session/message-updater.ts handles session.next.compaction.ended by appending a SessionMessage.Compaction with id, metadata, reason, summary, recent, and creation timestamp; it does not attach or update an assistant message.