Dashboard › opencode › Distillation
d9b36587-0ff0-4ff4-ac0f-2c5632e496c8["lore_tm_v1_UOFBv0xs35Z_TD7S38NwfTOJpWMaQ5ddBC9TiFRRD8g","lore_tm_v1_G3Hj8rj7WpXkfqjYJXLAXi_-JbRZvCd_6U3mIiCX2v8","lore_tm_v1_tBBs-zwzlgRNljIZGNWIjo-yDFCbLBP-UZ4cbGocVEY","lore_tm_v1_Aomd7scVp9SqmRDPn46saM7D1COeFPNoPgypBIb7_EA","lore_tm_v1_jrg6ePEgaWj__H0zY3MPFyuGrAixRnxXgDT7-maCaRw"]
Date: Sep 15, 2026
packages/schema/src/session-event.ts found RetryError includes optional statusCode: Schema.Finite, required isRetryable: Schema.Boolean, and optional responseHeaders, responseBody, and metadata; its identifier is "session.next.retry_error".Retried in packages/schema/src/session-event.ts defines event type "session.next.retried" with Base, finite attempt, and error: RetryError.SessionEvent.Compaction.Started defines "session.next.compaction.started" with Base, messageID: SessionMessage.ID, and reason restricted to "auto" or "manual".SessionEvent.Compaction.Delta defines "session.next.compaction.delta" with Base, messageID: SessionMessage.ID, and text: Schema.String; unlike Started and Ended, the shown definition does not spread ...options.SessionEvent.Compaction.Ended defines "session.next.compaction.ended" with Base, messageID: SessionMessage.ID, reason reused from Started.data.fields.reason, text: Schema.String, and recent: Schema.String.RevertEvent in packages/schema/src/session-event.ts defines three events: "session.next.revert.staged" with revert: Revert.State; "session.next.revert.cleared" with only Base; and "session.next.revert.committed" with messageID: SessionMessage.ID.packages/core/src/session/prompt.ts is a one-line re-export of AgentAttachment, FileAttachment, Prompt, and Source from @opencode-ai/schema/prompt.packages/core/src/session/compaction.ts defines compaction constants DEFAULT_BUFFER = 20_000, DEFAULT_KEEP_TOKENS = 8_000, TOOL_OUTPUT_MAX_CHARS = 2_000, and SUMMARY_OUTPUT_TOKENS = 4_096.SUMMARY_TEMPLATE in packages/core/src/session/compaction.ts requires exact Markdown section order: ## Objective; ## Important Details; ## Work State with ### Completed, ### Active, and ### Blocked; ## Next Move with numbered actions 1. and 2.; and ## Relevant Files. It instructs the model not to emit the surrounding <template> tags and provides "(none)" fallbacks where applicable.Settings contains readonly auto: boolean, buffer: number, and tokens: number; Dependencies contains events: EventV2.Interface, an llm.stream(request: LLMRequest) returning Stream.Stream<LLMEvent, LLMError>, and readonly config: readonly Config.Entry[].CompactInput extends Input with optional beforeStream?: () => Effect.Effect<void> and eventCommit?: () => Effect.Effect<void>, while Input separately contains optional commit?: () => Effect.Effect<void> plus sessionID, readonly entries, model, and request.packages/core/src/session/compaction.ts uses Token.estimate(JSON.stringify(value)).TOOL_OUTPUT_MAX_CHARS (2_000 characters); longer strings are sliced to the first 2_000 characters and suffixed with \n[truncated].serializeToolContent() converts text tool-content items to their raw item.text; non-text items become [Attached ${item.mime}] or [Attached ${item.mime}: ${item.name}], then all items are joined with newline separators.[User]: ${message.text} followed by each file as [Attached ${file.mime}: ${file.name ?? file.uri}], joined by newlines; assistant text parts serialize as [Assistant]: ${part.text}.