Dashboard › opencode › Distillation
846347b4-a69b-4346-9e13-8366be16a401["lore_tm_v1_krOl8w7AQ_TbwRq2eMtl2j2vDuxonmfqruOqryfziuo","lore_tm_v1_JYTLhisqGRZAziES0US0faBRGC4J-Mlwjt5S9v5vx6U"]
Date: Sep 15, 2026
/home/byk/Code/opencode/packages/core/src/session/runner/llm.ts:95-164 showed the layer initializes EventV2.Service, LLMClient.Service, AgentV2.Service, ToolRegistry.Service, SessionRunnerModel.Service, SessionStore.Service, Location.Service, SystemContextRegistry.Service, SkillGuidance.Service, ReferenceGuidance.Service, Config.Service, Snapshot.Service, and Database.Service; it creates compaction with SessionCompaction.make({ events, llm, config: yield* config.entries() }).getSession in /home/byk/Code/opencode/packages/core/src/session/runner/llm.ts:112-116 calls store.get(sessionID) and dies with Session not found: ${sessionID} when no session exists; getContext at lines 118-120 delegates to store.context(sessionID).failInterruptedTools in /home/byk/Code/opencode/packages/core/src/session/runner/llm.ts:121-141 scans assistant messages from getContext(sessionID) and publishes SessionEvent.Tool.Failed for tool entries whose status is "pending" or "running". The event includes sessionID, DateTime.now, assistantMessageID, callID, error { type: "unknown", message: "Tool execution interrupted" }, provider.executed normalized to a boolean, and optional provider.metadata./home/byk/Code/opencode/packages/core/src/session/runner/llm.ts:143-144 defines awaitToolFibers as Effect.raceFirst(FiberSet.join(fibers), FiberSet.awaitEmpty(fibers))./home/byk/Code/opencode/packages/core/src/session/runner/llm.ts:146-152 documents that, matching V1, declining a user prompt halts the loop rather than becoming model-facing tool output. isUserDeclined detects a die reason whose defect is PermissionV2.DeclinedError or QuestionV2.RejectedError./home/byk/Code/opencode/packages/core/src/session/runner/llm.ts:154-163 defines TurnTransition variants { readonly _tag: "ContinueAfterCompaction"; readonly step: number } and { readonly _tag: "ContinueAfterOverflowCompaction"; readonly step: number }; TurnTransitionError extends Error and stores a readonly transition.Compaction-related matches in /home/byk/Code/opencode/packages/schema/src/session-event.ts: namespace Compaction at line 423; event types "session.next.compaction.started" at line 425, "session.next.compaction.delta" at line 436, and "session.next.compaction.ended" at line 446; registrations/references to Compaction.Started and Compaction.Ended at lines 499-500, plus Compaction.Started, Compaction.Delta, and Compaction.Ended at lines 535-537.