Dashboard › opencode › Distillation
45664305-e8c6-43db-b8db-fb9629e5f2f1["lore_tm_v1_4HUqznZdwoHjWMiC8wrem10lbBxzDlNkSBwNclcgIxc","lore_tm_v1_XOUINqPFlRN_ZeQAkvuWLpDE-08dyCVKNgCnw5o7ZGU","lore_tm_v1_PXOQKwVZ6GKZuC0l6Vl90t_praf9N0z3n75IFN1CJ74","lore_tm_v1_21GuQsoyR5pMVLTUK82rNOCXPpRCskxiiHDxMrKTlN4","lore_tm_v1_RFXvc8PrCtEJhKFm9_5Ju6U9wC3go2vQ7nmHefy5CQA","lore_tm_v1_gpgM8KfK-Z7uAksGj537iZuhjFMGye_P6hy7LUXXYFc","lore_tm_v1_eC8s4zEf7207CrEkmjoYvDEt6AU29FkgKFzE85uy7Ho"]
Date: Sep 14, 2026
/home/byk/Code/opencode/packages/core/src/session/runner/to-llm-message.ts translates projected V2 SessionMessage.Message[] into canonical @opencode-ai/llm Message[] through toLLMMessages; "agent-switched" and "model-switched" records are omitted.toLLMMessages converts user messages to text plus FileAttachment media parts (mediaType=file.mime, data=file.uri, filename=file.name, optional description metadata), synthetic messages to user messages, system messages via Message.system, and shell messages to Shell command: ${message.command}\n\n${message.output}./home/byk/Code/opencode/packages/core/src/session/runner/to-llm-message.ts become user messages wrapped in <conversation-checkpoint> with <summary> and <recent-context>, explicitly describing the content as historical context rather than new instructions."reasoning" only when the historical and current provider/model IDs match; for a different model, nonempty reasoning becomes plain text. Provider metadata is reused only for the same model when message.error === undefined."pending"; pending string input is parsed with JSON.parse, falling back to the original string on parse failure.ToolCallPart for every tool. Provider-executed tools place their result beside the call in assistant content; non-provider-executed completed/error results become separate Message.tool messages. Completed results use a provider result when available, otherwise ToolOutput.toResultValue({ structured, content }); errors use resultType: "error" and preserve error, content, and structured./home/byk/Code/opencode/packages/core/src/session/runner/to-llm-message.ts retains a TODO to materialize remote and managed URIs before provider-history lowering because ToolOutput.toResultValue rejects unresolved URIs instead of treating them as media bytes./home/byk/Code/opencode/packages/core/src/session/execution.ts defines SessionExecution.Interface: active snapshots session IDs executing in the current process; resume(sessionID) starts idle execution or joins active execution; wake(sessionID) registers newly recorded work with coalescible wakeups; and interrupt(sessionID) interrupts locally owned active work while remaining a no-op when idle.SessionExecution.Service is the @opencode/v2/SessionExecution context service and is exposed as an unbound global LayerNode; SessionExecution.noopLayer supplies empty/no-op implementations for callers needing only durable session recording./home/byk/Code/opencode/packages/core/src/session/execution/local.ts implements current-process routing for implicit-local Locations using SessionRunCoordinator.make<SessionSchema.ID, SessionRunner.RunError>. Its drain loads the session from SessionStore.Service, dies with Session not found: ${sessionID} when absent, invokes runner.run({ sessionID, force }) under locations.get(session.location), suppresses interrupt-only logging, and logs other causes as Failed to drain Session with sessionID.SessionExecutionLocal.node is a global node depending on SessionStore.node and LocationServiceMap.node; its service delegates active, interrupt, resume, and wake to the coordinator’s active, interrupt, run, and wake./home/byk/Code/opencode/packages/server/src/routes.ts builds applicationServices from Database.node, EventV2.node, httpClient, ToolOutputStore.cleanupNode, SessionV2.node, PermissionSaved.node, PtyTicket.node, Credential.node, PtyEnvironment.node, and LocationServiceMap.node.[SessionExecution.node, SessionExecutionLocal.node] through AppNodeBuilder.build; the HTTP API exposes OpenAPI at /openapi.json and provides handlers, sessionLocationLayer, locationLayer, authorizationLayer, schemaErrorLayer, authentication, and the built service layer./home/byk/Code/opencode/packages/server/src/routes.ts configures password-based routes with username "opencode" and Option.some(password), embedded routes with username "opencode" and Option.none(), and creates webHandler with { disableLogger: true }.