Dashboard › opencode › Distillation
37ded3a6-dfc1-4555-92a0-8d9e45d4cd36["lore_tm_v1_cHKXTe6XmJ8KJgKIDZvL2Y_MKzILAwyjyd1nVlHrYmQ","lore_tm_v1_9yKzeN0XTaXGxGXuEANDyBSuHcOa-bqTMaEZzFKjIt4","lore_tm_v1_XByRsHoAPrR45f5gQCRWgw3qjc4tC7jmY_KyyieBHrM","lore_tm_v1_UjhYNNKx0znpzZaprZ9VqICktiJEWSdaFwQDQvoZjvE","lore_tm_v1_xlxuXXUDT4mvsDFSZv0LBXTmjRMs0nQ1pm3RW1gtGA8","lore_tm_v1_oInyBPKXoBRWSVCjmPUZQPKdtnvfj-PVVZy9uIoZlkI","lore_tm_v1_uYnbOBsl0omceV2fjfXK-0f3VtIaLCORV4v7HMLahUo","lore_tm_v1_OGvv4jQULMliKSYAeekmy9esTklG55hvyfGS4i1dXBw","lore_tm_v1_Sn8AsqgLwS2Ueibxs_3c-1DH7EmPxUe2qeLA7F_vYyg","lore_tm_v1_qMgYPZKwF-47HEM-qMrocYXoztReystDN0YGXHteOBk","lore_tm_v1_wngK8yZnNKXDUUgh9FFm_w8L_HWV1gnZCHsztWQt7-0","lore_tm_v1_oHw8lRjUOXoc9aYoqjXDZSV05x919eRTf5sCo-h3i4s","lore_tm_v1_gf2XpZ7Vs302-FnB-9_aQja4RnqrBGvtds0_GHAzqLk","lore_tm_v1_h_QhhXBXhNHp-Sf0RCFmuSLdP_Ws5rfgsHOAJyGnuis","lore_tm_v1_D8XJMECMoyd1OR_CYL9tvtGpKZWaKeQbzJjwMI4HTTI","lore_tm_v1_H3UZrsw2IC3_4Sqp8GDK40HgDoeyL2FVJGAG6gTi2NQ","lore_tm_v1_If2o8QutwTVNswYxtYj0RylL29yg5vdhd9A4xVOtWPU","lore_tm_v1_osOq3HkfjMhYvFXfykg-2a6QHA5yHyDG1Id2AonmyKM","lore_tm_v1_raJbFBxx1xnhy969QEntNMR5tNW0cVscYKcBkm5U95I","lore_tm_v1_1cdjKsOacoEWnW9G_xGb3mpoQAzvzhqhZdVQ3sjJHRk"]
Date: Sep 15, 2026
packages/core/src/session/runner/publish-llm-event.ts, which defines runner publication state and exposes publish, flush, failAssistant, interruptAssistant, failUnsettledTools, hasActiveAssistant, hasAssistantStarted, hasProviderError, stepSettlement, startAssistant, and assistantMessageID.packages/core/src/session/runner/publish-llm-event.ts, "tool-error" requires an existing called tool, rejects a changed tool name and duplicate settlement, marks the tool settled, and publishes SessionEvent.Tool.Failed with { type: "unknown", message: event.message }, execution provenance, and optional provider metadata. Exact defects are "Tool error before call: ${event.id}", "Tool error name changed for ${event.id}: ${tool.name} -> ${event.name}", and "Duplicate tool error: ${event.id}".packages/core/src/session/runner/publish-llm-event.ts, "step-finish" flushes buffered fragments, sets assistantActive = false, rejects an existing settlement with "Duplicate step finish", and records { finish: event.reason, tokens: tokens(event.usage) }; "provider-error" sets providerFailed = true and calls failAssistant(event.message).tsgo --noEmit; it completed with no reported diagnostics.packages/core/src/session/message-updater.ts: latestText and latestReasoning use findLast, while updateOwnedAssistant retrieves an assistant through adapter.getAssistant(messageID) and only calls adapter.updateAssistant(produce(...)) when that assistant exists.packages/core/src/session/message-updater.ts projections append SessionMessage.AgentSwitched, SessionMessage.ModelSwitched, SessionMessage.User, and SessionMessage.System records for their corresponding events; "session.next.moved" and "session.next.prompt.admitted" are projection no-ops.packages/core/src/session/message-updater.ts handles "session.next.step.recovered" by doing nothing for phase "continue". Phase "unknown" maps to "Provider Step outcome unknown after server restart"; other recoverable phases map to "Session execution interrupted by server restart".assistantMessageID appends a synthetic message whose ID is message(event.data.executionID) and whose text is the recovery error. With an assistant ID, it marks the owned assistant completed with finish: "error", assigns the error, appends text part ID recovery:${event.data.executionID}, and begins closing pending/running tool content.packages/core/src/session/input.ts; the tool reported success.packages/core/test/session-runner.test.ts helpers: messageTexts extracts text content by role, userTexts and systemTexts specialize it, and replaySessionProjection loads durable events ordered by EventTable.seq, removes the aggregate, deletes its SessionInputTable and SessionMessageTable rows, then calls events.replayAll(...).packages/core/test/session-runner.test.ts defines fragment testing over exactly ["text", "reasoning", "tool input"]; fragmentID uses prefix "call" for tool input and otherwise uses the fragment kind."continues with reloaded history after durably settling one local tool call" configures an echo call with { text: "hello" }, then a final text "Done". It expects 2 provider requests; second-request roles ["user", "assistant", "tool"]; authorization { sessionID, toolCallID: "call-echo" }; executions ["hello"]; a completed tool with structured { text: "hello" } and text content "hello"; and a terminal assistant with finish: "stop" and text ID "text-final".packages/core/src/session/compaction.ts: automatic summary generation reserves summaryOutput = Math.min(output || SUMMARY_OUTPUT_TOKENS, SUMMARY_OUTPUT_TOKENS), declines when the summary prompt exceeds context - summaryOutput, publishes SessionEvent.Compaction.Started with reason "auto", and streams an LLM request with no tools and generation.maxTokens = summaryOutput.LLMEvent.textDelta text, marks provider errors, catches LLM.Error as an unsuccessful summary, and returns false if streaming failed, a provider error occurred, or the joined summary is blank. Success publishes SessionEvent.Compaction.Ended with the summary and selected.recent, using { commit: input.commit }.compactIfNeeded returns false when auto-compaction is disabled, model context is absent/nonpositive, or estimated system/messages/tools tokens fit within context - Math.max(output, config.buffer); otherwise it calls compactAfterOverflow(input).packages/schema/src/session-event.ts: SessionEvent.Step.Failed uses durable version 2 and includes assistantMessageID plus UnknownError; SessionEvent.Step.Interrupted uses standard durable version 1 and includes the same fields; SessionEvent.Step.Recovered uses durable version 1 with executionID, optional assistantMessageID, and phase restricted to "ready", "unknown", or "continue".packages/schema/src/session-event.ts defines standard durable options as aggregate "sessionID" and version 1; step-settlement durable options use aggregate "sessionID" and version 2.packages/core/src/event.ts notification behavior: notify(event, isolateListeners) visits all listeners in order with discarded results, wrapping each with observe only when isolation is requested, then publishes to the event-type-specific PubSub if present and finally to the all-events PubSub.packages/core/src/event.ts listener isolation logs non-interrupt failures as "Event listener failed" with { eventID, eventType, cause }; interrupt causes are excluded from that logging path.packages/core/src/event.ts publish derives location from explicit options.location or Location.Service, creates an event ID unless options.id is supplied, conditionally includes metadata/location, and passes options.commit to publishEvent.packages/core/src/session/runner/llm.ts; a subsequent update modified both packages/core/src/session/runner/llm.ts and packages/core/src/session/recovery.ts. Tools reported all updates succeeded.packages/core/src/session/execution/local.ts phase checks: new local execution starts in phase "ready"; cleanup queries the current phase; and claim clearing after failure excludes both "unknown" and "continue" phases.packages/core/test/session-projector.test.ts in two successive successful updates.