Dashboard › opencode › Distillation
e2c92572-f351-4f33-b44b-284e30db7137["lore_tm_v1_6zDrONyJoNQxbX0xq2ijoCY3jWLiSAW3wapWwE3eXWs","lore_tm_v1_BFE847UTkrrgPDlT0503zNUZSELMFTKthJFF9GMeG7w","lore_tm_v1_G1FWqNqcLPmhgb2mpkBXCGN0D_OojLxjesxMNhegYi8"]
Date: Sep 17, 2026
packages/core/src/session/compaction.ts changed automatic compaction to publish durable events through dependencies.events.publish(...) before and after summary generation, with both payloads carrying sessionID: input.sessionID and reason: "auto".input.beforeStream() after publishing the initial compaction event and immediately before starting LLM.request(...); the generated summary still joins collected LLMEvent.is.textDelta(event) chunks and the function returns true.packages/core/src/session/compaction.ts retains compaction defaults and limits: DEFAULT_BUFFER = 20_000, DEFAULT_KEEP_TOKENS = 8_000, TOOL_OUTPUT_MAX_CHARS = 2_000, and SUMMARY_OUTPUT_TOKENS = 4_096. Configuration reduction uses document info.compaction values for auto, buffer, and keep.tokens, defaulting to { auto: true, buffer: DEFAULT_BUFFER, tokens: DEFAULT_KEEP_TOKENS }.prepareOnce(...) and initializeOnce(...) now accept claim: SessionExecutionClaim.Claim, and both pass that claim into insert(db, sessionID, generation, claim).packages/core/src/session/sql.ts defines MAX_WAKE_ATTEMPTS = Number.MAX_SAFE_INTEGER; both session_wake_attempts_check and session_recovery_wake_attempts_check constrain wake attempts to >= 0 and <= MAX_WAKE_ATTEMPTS.SessionInputTable (session_input) fields are id, session_id, JSON prompt, delivery, admitted_seq, nullable promoted_seq, wake_pending defaulting to false, and time_created defaulting to Date.now(). It has index session_input_session_pending_delivery_seq_idx, unique indexes session_input_session_admitted_seq_idx and session_input_session_promoted_seq_idx, and wake index session_input_wake_pending_promoted_session_idx.SessionRecoveryTable (session_recovery) stores session_id, execution_id, nullable assistant_message_id, required continuation_message_id, phase "ready" | "unknown" | "continue", wake_pending defaulting to true, wake_attempts defaulting to 0, nullable recovery_error, and time_created. Its primary key session_recovery_pk is on execution_id; continuation_message_id is unique via session_recovery_continuation_message_idx; recovery scans use session_recovery_wake_pending_error_attempts_created_execution_idx.SessionExecutionTable (session_execution) implements durable execution ownership with fields: id, session_id, required owner_id, nullable assistant_message_id, phase "ready" | "safe" | "unknown" | "continue" | "cancelling" | "cancelled", assistant_seq defaulting to -1, time_created, expires_at, and nullable recovery_error.SessionExecutionTable constraints and indexes are: primary key session_execution_pk on id; unique index session_execution_session_idx on session_id, allowing only one execution per session; session_execution_owner_idx on owner_id; recovery index session_execution_recovery_scan_idx on (recovery_error, expires_at, time_created, id); and session_execution_phase_check restricting phase to 'ready', 'safe', 'unknown', 'continue', 'cancelling', 'cancelled'.SESSION_EXECUTION_LEASE_MS = 30_000.SessionContextEpochTable (session_context_epoch) uses session_id as a cascading foreign-key primary key and persists baseline, JSON snapshot typed as SystemContext.Snapshot, and baseline_seq.