Dashboard › opencode › Distillation
902eeb8b-5367-49b9-9651-c9f9129e54a3["lore_tm_v1_X7dmMCsHwmuS3HD04jX33nYX5Jsqi7xqJu20rpGAfsA","lore_tm_v1_45fbJbv1AmmdDTofRisj69AuQnuLJc0WjjZJ7GjK66c","lore_tm_v1_R6nvVYDrrHib4dqUWin504ZfizfZoiKxob7fR1ZZ_qc"]
Date: Sep 16, 2026
SessionRunner’s roadmap still has unchecked work to honor interruption and reject stale work after runtime attachment replacement.SessionRunner’s completed roadmap items include persisting assistant text and usage events incrementally as they arrive and reloading projected history to start the next explicit provider turn after local tool results.packages/core/src/session/compaction.ts defines compaction defaults DEFAULT_BUFFER = 20_000, DEFAULT_KEEP_TOKENS = 8_000, TOOL_OUTPUT_MAX_CHARS = 2_000, and SUMMARY_OUTPUT_TOKENS = 4_096.## Objective, ## Important Details, ## Work State with ### Completed, ### Active, and ### Blocked, then ## Next Move with numbered items 1 and 2, and ## Relevant Files.SUMMARY_UPDATE_INSTRUCTIONS says a new summary must combine <prior-summary> and <conversation> because the prior summary is discarded; carry forward unfinished objectives, constraints, directives, decisions, and parallel workstreams; prefer the newer conversation on conflicts; add new progress/context; move completed work to Completed; update resolved blockers while retaining continuation details; and refresh Objective and Next Move.packages/core/src/session/compaction.ts resolves configuration by reducing all document entries with info.compaction; later configured values override earlier ones through auto, buffer, and keep.tokens, with defaults { auto: true, buffer: 20_000, tokens: 8_000 }.serializeToolContent(...) renders text items directly and attachments as [Attached ${item.mime}] or [Attached ${item.mime}: ${item.name}]; serialized tool and shell output longer than 2_000 characters is sliced to 2_000 characters and suffixed with \n[truncated].[User], [Assistant], [Assistant reasoning], [Assistant tool call], [Tool result], [Tool error], [System update], [Synthetic context], and [Shell]; user files are represented as [Attached ${file.mime}: ${file.name ?? file.uri}].select(...) algorithm excludes messages with type === "compaction", serializes nonempty messages, then walks backward while the estimated token total remains within the keep-token limit; it returns older content as head and retained tail content as recent.buildPrompt(...) creates a new anchored summary from <conversation> when there is no prior summary. With a prior summary, it includes <conversation>, <prior-summary>, SUMMARY_UPDATE_INSTRUCTIONS, and SUMMARY_TEMPLATE in that order.SessionCompaction.compactIfNeeded(...) returns false when automatic compaction is disabled, the model context limit is absent/nonpositive, or estimated { system, messages, tools } input is at most context - Math.max(output, config.buffer); otherwise it delegates to compactAfterOverflow(...).SessionCompaction.compactAfterOverflow(...) uses input.request.generation?.maxTokens, falling back to the model output limit and then 0; chooses a summary output limit of Math.min(output || 4_096, 4_096); and refuses compaction if the summary prompt estimate exceeds context - summaryOutput.compactAfterOverflow(...) finds the first existing compaction message, supplies its summary as previousSummary, and combines its saved recent text with the newly selected older head; it returns false if there is neither selected head content nor an existing compaction summary.SessionMessage.ID, publishes SessionEvent.Compaction.Started with reason: "auto" and an optional eventCommit, then invokes optional beforeStream().Message.user(summaryPrompt), disables tools with tools: [], and sets generation.maxTokens to the computed summary output limit.LLMEvent.is.textDelta(...) text, marks any LLMEvent.is.providerError(...) as failure, converts tagged LLM.Error failure to false, and declines to publish a completed compaction when streaming failed, a provider error occurred, or the resulting summary is blank.SessionEvent.Compaction.Ended with the same sessionID and messageID, a fresh timestamp, reason: "auto", generated text, and selected recent, using { commit: input.commit }; it then returns true.