Dashboard › opencode › Distillation
c627e25f-5e7b-4cfd-994f-9b263ebe40b5["lore_tm_v1_tpfk4NP0n2TyGsL7-n6K9TC_GNAv0U7RglHgs_APxSw","lore_tm_v1_offnqjLmf46BIEd2ZgNw0BkHbBtSFkELrlwW_BCO38c","lore_tm_v1_8njziaaJGX3qOBIwwXb1afAhbjHBIXSIvVbQhPdC92s","lore_tm_v1_gTo4FKXljxtcM-WMvFnAU4SXJWcFkWayor26ewwR0UE","lore_tm_v1_sh2_fU7jh1nEsJalQZ9ftK8MLSI-tYiJ1TppHhBhx-o"]
Date: Sep 14, 2026
/home/byk/Code/opencode/packages/core/src/session/projector.ts:22: “A newer turn supersedes stale incomplete rows; never resume an older assistant projection.”/home/byk/Code/opencode/packages/core/src/session/history.ts loads projected session history using SessionMessageTable.seq: latestCompaction() selects the newest "compaction" row; messageRows() orders rows ascending and combines the compaction boundary with SessionContextEpochTable.baseline_seq, retaining system messages only when their sequence is newer than the baseline. load() fetches epoch and compaction concurrently with { concurrency: "unbounded" }; loadForRunner() returns messages, while entriesForRunner() returns { seq, message } entries./home/byk/Code/opencode/packages/core/src/session/history.ts:55-64 decodes stored rows with SessionMessage.Message; decode failures become MessageDecodeError containing the row’s sessionID and messageID./home/byk/Code/opencode/packages/core/src/session/runner/to-llm-message.ts translates projected V2 SessionMessage.Message[] into canonical @opencode-ai/llm Message[]. User file attachments become "media" parts with MIME type, URI, filename, and optional description metadata; shell messages become user content formatted as Shell command: ${message.command}\n\n${message.output}; "agent-switched" and "model-switched" messages are omitted./home/byk/Code/opencode/packages/core/src/session/runner/to-llm-message.ts:21-27 parses pending tool input as JSON when possible and preserves the original string when parsing fails./home/byk/Code/opencode/packages/core/src/session/runner/to-llm-message.ts:70-113 reuses reasoning and tool provider metadata only when the historical assistant message’s provider/model match the current Model and the assistant message has no error. Reasoning from a different model is lowered to text when nonempty. Provider-executed tools place call and result in assistant content; non-provider-executed tool results become separate Message.tool messages./home/byk/Code/opencode/packages/core/src/session/runner/to-llm-message.ts:39-68 lowers completed tool state through ToolOutput.toResultValue({ structured, content }), except provider-executed tools can reuse tool.state.result; errored tools produce resultType: "error" with { error, content, structured } unless a provider-executed result is available. A TODO notes that remote and managed URIs must be materialized before provider-history lowering because ToolOutput.toResultValue rejects unresolved URIs./home/byk/Code/opencode/packages/core/src/session/runner/to-llm-message.ts:147-165 lowers compaction records to user-role <conversation-checkpoint> content containing <summary> and <recent-context>, explicitly describing the record as historical context rather than new instructions.{ uri: "data:image/png;base64,aGVsbG8=", name: "image.png" }, event ordering beginning with "session.next.prompt.admitted", resume behavior, exact retry behavior, concurrent exact retries returning one recorded message, steering promotion via SessionInput.promoteSteers(...), and an admitted message with promotedSeq: 1.