Dashboard › opencode › Distillation
faae2329-e4fb-4c3b-8adc-00bbcd9b0ccf["lore_tm_v1_wzN2lDcTGZlzYWaqw59y0gb6oed5cgeJee-Pygz3K4s","lore_tm_v1_a-NtOunDr5oFNhmRkg1bgiGB_8EJpTdKv14f3kFjYig","lore_tm_v1_goH_PukeXUWEzRGZarXJlC6jJ-QW4nN7ZVzvSMp-OiE","lore_tm_v1_PFGdFgEIM1Gou3w42rwfuIfURwm3JHNli0zmF0SgT5Q","lore_tm_v1__h3kx_xOxy8xV6c3PIZJ43e7DEWdMAOARS1SyhdoUIo"]
Date: Sep 16, 2026
packages/core/test/session-runner.test.ts:731.packages/core/test/session-runner.test.ts:757.packages/core/test/session-runner.test.ts:784.packages/core/test/session-runner.test.ts:824.packages/core/test/session-runner.test.ts:1954.packages/core/src/session/execution/local.ts sets expires_at: now + leaseDuration at line 39, races execution at line 62, and clears claims through SessionExecutionClaim.clear(db, claim) on exit/interruption paths at lines 77, 94, and 109.packages/core/src/session/recovery.ts finds recoverable executions where expires_at <= scanTime and recovery_error IS NULL at line 70; recovery claims set owner_id and expires_at: now + SESSION_EXECUTION_LEASE_MS at line 82 and require the prior lease to remain expired at line 88.packages/core/src/session/recovery.ts validates continuation identity with SessionInput.validateRecovery(db, row.continuationMessageID) at line 214, atomically increments SessionRecoveryTable.wake_attempts at lines 233–237, and invokes execution.wake(row.sessionID) only when the guarded update succeeds at line 244.packages/core/src/session/recovery.ts uses min(${SessionInputTable.wake_attempts}) as firstAttempt at line 255, atomically increments SessionInputTable.wake_attempts at lines 278–282, and wakes the session only after a successful guarded update at line 291.packages/core/src/session/run-coordinator.ts defines interrupt: (key: Key, cleanup?: Effect.Effect<void>) => Effect.Effect<void> at line 14; interruption first calls Fiber.interrupt(owner) and then captures cleanup completion with Effect.exit(cleanup) at lines 107–108.packages/core/src/session/runner/llm.ts:283 configures interruptedCommit as SessionExecutionClaim.clear(db, claim). Interrupted or incomplete streams publish unsettled-tool failures through withPublication(...): "Tool execution outcome unknown after interruption" at line 382, "Tool execution interrupted" at line 396, and "Provider did not return a tool result" at line 398 when the stream succeeded without a provider error.SessionInput.validateRecovery is exported from packages/core/src/session/input.ts:321; it loads the latest assistant at line 347 and can return "Invalid recovery projection identity" when recovery.assistant_message_id differs from the latest assistant ID or when the latest assistant’s seq exceeds input.admitted_seq at lines 391–394.SessionInput.promoteExact is exported from packages/core/src/session/input.ts:561; failed promotion records defect.reason in SessionRecoveryTable.recovery_error at line 587 under an isNull(SessionRecoveryTable.recovery_error) guard at line 592.packages/core/test/session-projector.test.ts includes: "never recovers an execution superseded by a newer assistant" at line 342; "quarantines a full batch of poison recovery rows before redriving valid work" at line 494; "fairly redrives recovery and ordinary work beyond a full bounded batch" at line 559; "quarantines a recovery wake behind a newer assistant" at line 949; and "never promotes a recovery superseded before scanner validation" at line 1064.failedCount = SessionRecovery.BATCH_SIZE + 1, builds both recovery and ordinary session sets of failedCount + 1, expects the first scan to wake exactly SessionRecovery.BATCH_SIZE * 2 sessions while excluding index failedCount, then expects a second scan to include both deferred sessions.packages/core/test/session-projector.test.ts use exact errors "Invalid recovery continuation input" and "Invalid recovery projection identity"; poisoned rows produce no wakes while valid work is redriven on a later recovery scan.packages/core/test/session-execution-local.test.ts close child/first scopes with Scope.close(..., Exit.void), exercise lease timing with three TestClock.adjust("10 seconds") calls at lines 169, 172, and 193, and test "settles cancellation before starting a pending successor" at line 200 using finalizerStarted and releaseFinalizer deferred synchronization.packages/core/test/session-run-coordinator.test.ts:285 tests "finalizes interruption when cleanup dies" using new Error("cleanup defect") at line 292.