Dashboard › opencode › Distillation
b637f772-7516-4e35-93c3-fee14b679358["lore_tm_v1_AOTNeu1LnKijBF5Itb-9MwhuZ-Rewct-lVPAP5ToMUU","lore_tm_v1_eh4zS9HYlKSlgJ3N3-yeg6-3pwvrTlZ-wzyGvTpuRM0","lore_tm_v1_uARTR70P1hOEzdo9uUWNBsYM8i6m_ko8DnYBW5Ch1X0","lore_tm_v1_ngMe-2Xy9NWvmxaKlQdmcqoEAW7dYdOGpPoX0cwXcSs","lore_tm_v1_008_X3V0vOKvP4TQoLWAordsJ31S4gEGE77vHo-vUJc","lore_tm_v1_bkCCMrudIKu5SAkJxKAx1O9d0queqF4bnZvD7HaCYIg","lore_tm_v1_mdo2VsYRGquzdqudEvt51YBVyy4Y61GcoXDPdbXruA4","lore_tm_v1_Gr5tYOCp4Z9PJxAUc7qjicNVED1gux5dszQryw47sUs"]
Date: Sep 15, 2026
packages/core/test/session-projector.test.ts covers a lease with expires_at: Date.now() + 60_000.packages/core/test/session-projector.test.ts includes this invariant with abandoned assistant ID msg_recovery_abandoned.packages/core/test/session-projector.test.ts recovery coverage includes: records a recovery continuation without forging an assistant identity; never recovers a live execution lease; never recovers an execution superseded by a newer assistant; redrives a durable recovery wake after admission; quarantines a malformed recovery row without blocking a valid wake; quarantines SessionRecovery.BATCH_SIZE + 1 poison rows before redriving valid work; quarantines a continuation belonging to another Session; redrives durable ordinary-input execution intent after a lost advisory wake; quarantines a recovery wake behind a newer assistant; quarantines a malformed claim without blocking a valid claim; and fences a paused owner after expiry, reconciliation, and takeover.executionID: "lost-wake" and continuation ID continuation("lost-wake"); SessionRecovery.recover() causes wakes to reach 2, while the persisted SessionRecoveryTable row remains wake_pending: true with recovery_error: null.poisonCount = SessionRecovery.BATCH_SIZE + 1, creates poisonCount + 1 sessions named ses_recovery_poison_${index.toString().padStart(3, "0")}, corrupts prompts via sql\UPDATE session_input SET prompt = '{}' WHERE time_created < ${poisonCount}`, initially wakes no sessions, quarantines exactly poisonCountrows, and on a later recovery wakes onlysessions[poisonCount]`.packages/core/test/session-runner.test.ts recovery coverage includes: redrives only the synthetic recovery continuation; recovers continuation committed with Compaction.Ended; persists a second context overflow after one recovery; publishes the original overflow when recovery summarization fails; interrupts overflow recovery while the summary provider runs; recovers continuation committed with a settled tool step; reloads a model switch before a tool-driven continuation turn; promotes queued input after continuation ends; promotes queued input after steering continuation ends; coalesces multiple active steering prompts into one continuation turn; interrupts runner continuation when permission approval is declined; and interrupts runner continuation when a question is dismissed.packages/core/test/session-runner.test.ts:1464-1508 verifies automatic compaction remains unknown until Compaction.Ended commits. During an uncommitted summary "## Objective\n- Interrupted", the test replaces the execution row with { id: "compaction-successor", owner_id: "successor", expires_at: 60_000 }; resume makes exactly 1 model request, projects no compaction message, and leaves { id: "compaction-successor", phase: "unknown" }.packages/core/test/session-runner.test.ts:1511-1560 verifies continuation recovery committed with Compaction.Ended: after summary "## Objective\n- Preserve recovery", modelResolveHook dies with "crash after Compaction.Ended" when execution phase becomes "continue". The execution remains in phase "continue", the compaction is present at context index 0, and no synthetic message is projected. After setting expires_at: 0, selecting recoveryModel, and running SessionRecovery.recover(), the model receives "continue" as its final user text, the same compaction remains at index 0, and context still contains no synthetic message.packages/core/test/session-runner.test.ts:1563-1584 checks compaction retains only complete serialized messages using boundaries EARLIER_BOUNDARY ${"a".repeat(3_000)} EARLIER_END and RECENT_BOUNDARY ${"b".repeat(3_000)} RECENT_END, summary "## Objective\n- Preserve the task", and final response "Continued".packages/core/test/session-runner.test.ts:1942-2000 verifies recovery after a settled tool step. Prompt "Recover settled tool continuation" calls tool echo as call-recovery with { text: "settled" }; a hook dies with "crash after settled Step.Ended" once execution reaches phase "continue". Before recovery, context contains the user prompt and one assistant tool-calls message whose tool is completed. After expiring the claim and calling SessionRecovery.recover(), the settled tool executes exactly once, the recovered requestβs user texts are ["Recover settled tool continuation", "continue"], the first two context messages remain unchanged, and exactly 1 SessionRecoveryTable row exists.packages/core/test/session-runner.test.ts:3235-3288 verifies a declined permission interrupts continuation. Tool declined dies with new PermissionV2.DeclinedError() after prompt "Call declined" and call ID call-declined; resume exits with an interrupt-only failure after exactly 1 model request. The assistant has finish: "error", top-level error "Tool execution declined", and tool error "Tool execution interrupted"; a SessionEvent.Step.Interrupted event exists, SessionExecutionTable is empty, subsequent SessionRecovery.recover() creates no recovery rows, and the request count remains 1.packages/core/test/session-runner.test.ts:3291-3337 verifies permission corrections are returned to the model rather than interrupting. Tool corrected originates PermissionV2.CorrectedError({ feedback: "Use another tool" }), maps it to new Tool.Failure({ message: "Use another tool" }), and is called as call-corrected after prompt "Call corrected". The runner makes exactly 2 model requests; context records the tool error "Use another tool" and then a final assistant message with finish: "stop".packages/core/test/session-prompt.test.ts:293-311 verifies execution intent is durably recorded before advisory wake. Prompt "Recover a lost advisory wake" is admitted, its SessionInputTable row has wake_pending: true and promoted_seq: null, and wakeCalls equals [sessionID].packages/core/test/session-prompt.test.ts:314-337 verifies an admit-only exact retry becomes durable execution intent. Initial prompt ID messageID with text "Resume this exact prompt" and resume: false leaves wake_pending: false; retrying the identical input with resume: true changes it to wake_pending: true and produces wakeCalls = [sessionID].packages/core/test/session-prompt.test.ts:340-362 verifies reusing one ID with a different prompt is rejected: after "Fix the failing tests", retrying messageID with "Delete the failing tests" yields Session.PromptConflictError, leaves session messages at length 0, and leaves exactly 1 admitted input.packages/core/test/session-prompt.test.ts:365-404 enforces the conflicting-retry wake invariant. An initial messageID prompt "Original prompt" with resume: false is retried as "Conflicting prompt" with resume: true; the result is Session.PromptConflictError, the stored row remains wake_pending: false, wakeCalls remains [], and a subsequent SessionRecovery.recover() also produces no wake.