Dashboard › opencode › Distillation
80e02abf-7cb8-4dfb-b777-3c567b53531e["lore_tm_v1_fzHv_TxFTeU0BTXKU4T3L--13n3sIv8ixlU4B80n4BM","lore_tm_v1_eWCcDOIYPYAM-4FAoiqOuxdp8w2cYBPEFsl4ocLxBrg","lore_tm_v1_FH1XFnv4KrulICYDpCrX93-qcmL3iEw_X8rEdyzI0IQ"]
Date: Sep 14, 2026
llm.stream(request) provider turn is streamed and defines continueAfterCompaction = (step: number) => new TurnTransitionError({ _tag: "ContinueAfterCompaction", step }).publisher.failUnsettledTools("Tool execution outcome unknown after interruption") for unsettled tool calls after interruption.packages/core/src/session/compaction.ts defines exact defaults: DEFAULT_BUFFER = 20_000, DEFAULT_KEEP_TOKENS = 8_000, TOOL_OUTPUT_MAX_CHARS = 2_000, and SUMMARY_OUTPUT_TOKENS = 4_096.packages/core/src/session/compaction.ts defines SUMMARY_TEMPLATE with sections in this exact order: ## Objective, ## Important Details, ## Work State (including ### Completed), and ## Next Move; instructions require preserving the section order, omitting the <template> tags, using terse bullets rather than prose paragraphs, and moving completed work from “Active” to “Completed.”packages/core/src/session/compaction.ts serializes shell messages as [Shell]: ${message.command}\n${truncate(message.output)} and completed tool output using [Tool result]: ${truncate(serializeToolContent(part.state.content))}.packages/core/src/session/compaction.ts collects summary text only when LLMEvent.is.textDelta(event) is true, appending event.text to chunks.packages/core/src/session/compaction.ts computes available context using context - Math.max(output, config.buffer).packages/server/src/routes.ts imports SessionExecution from @opencode-ai/core/session/execution and SessionExecutionLocal from @opencode-ai/core/session/execution/local; its service layer is built with AppNodeBuilder.build(applicationServices, [[SessionExecution.node, SessionExecutionLocal.node]]).packages/server/src/routes.ts also wires core services including Database, EventV2, Credential, PermissionSaved, PtyTicket, SessionV2, SessionRecovery, ToolOutputStore, and LocationServiceMap.node.packages/opencode/src/server/routes/instance/httpapi/server.ts contains lazy server-related module behavior so non-serving processes such as CLI and scripts avoid module-load cost; visible route composition includes rootApiRoutes, instanceApiRoutes, instanceRoutes, workspaceRoutingLayer, and authorizationRouterMiddleware.