Dashboard › opencode › Distillation
9de7f51c-cc82-45db-ad6a-81e8bd9c05a9["lore_tm_v1_Sd_09VF4A4dhBB_0xanlt4MGbj2vwwpAVPrDO01Autc","lore_tm_v1_9NdODMlRghZT7ocxYB2DzTFIg7rKI7O9XkcvKqL8Ywo","lore_tm_v1_D4Hke4mYl7Q40kQe52xgAsTGvrIdBvk98Xv_YQ3XXNY","lore_tm_v1_-q9c2jIOdH0SeX4vCg7Cay3tO6iqWtFoGSJ0CV1niYM","lore_tm_v1_EL9GJuGBClUdg6985jFJB4TYnU7O0QHRm2UCUPqp5DA","lore_tm_v1_8ZPODUlC9dS33NcBhJ0gk2OhP_X3wOKaxgfVDD0NxiQ"]
Date: Sep 16, 2026
packages/core/src/session/message-updater.ts uses assistant-message ownership checks via updateOwnedAssistant(event.data.assistantMessageID, ...), preventing events from mutating a superseded assistant projection.packages/core/src/session/message-updater.ts, "session.next.tool.failed" only transitions a matching tool from "pending" or "running" to "error"; it preserves provider execution state, provider metadata, structured/content data for running tools, records event.data.result, and sets completion time to event.data.timestamp.packages/core/src/session/context-epoch.ts makes context-epoch writes ownership-sensitive by passing SessionExecutionClaim.Claim through initialize(), prepare(), insert(), replace(), and advance() and wrapping mutations in SessionExecutionClaim.transaction(...).SessionContextEpoch.prepare() concurrently loads current SystemContext, the stored context epoch, and SessionHistory.latestCompaction; it initializes when no epoch exists, uses SystemContext.replace when a newer compaction sequence supersedes stored.baseline_seq, otherwise uses SystemContext.reconcile, and publishes SessionEvent.ContextUpdated with a claim-guarded advance(...) commit when reconciliation produces an update.packages/core/src/session/compaction.ts compaction defaults are 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, and ## Relevant Files; rules require every section, terse bullets, exact paths/symbols/commands/errors/URLs/identifiers, and no mention of compaction or the summary process.<prior-summary> with newer <conversation>, carrying forward active objectives, constraints, directives, decisions, and parallel workstreams; newer conversation wins conflicts, completed work moves from Active to Completed, resolved blockers are updated, and Objective/Next Move reflect current state.SessionCompaction.compactIfNeeded triggers only when automatic compaction is enabled and estimated system/messages/tools tokens exceed context - Math.max(output, config.buffer); compactAfterOverflow preserves the configured recent-token tail, limits summary generation to at most 4_096 tokens, publishes SessionEvent.Compaction.Started, rejects failed/provider-error/blank summaries, and publishes SessionEvent.Compaction.Ended with both generated summary text and selected.recent.packages/server/src/routes.ts builds application services with Database.node, EventV2.node, httpClient, ToolOutputStore.cleanupNode, SessionV2.node, SessionRecovery.node, PermissionSaved.node, PtyTicket.node, Credential.node, PtyEnvironment.node, and LocationServiceMap.node; AppNodeBuilder.build(applicationServices, [[SessionExecution.node, SessionExecutionLocal.node]]) supplies execution services to routes./openapi.json; createRoutes(password?) uses username "opencode" with an optional password, while createEmbeddedRoutes() uses username "opencode" with Option.none().