Dashboard › opencode › Distillation
ca74d607-bbae-4e5c-9c23-c6c2ed13e321["lore_tm_v1_p276l67KFH3rGOCpncV2vHvREYRdJzm-_6_7X6ppyB8","lore_tm_v1_j3IK6JCbJqyoActgM9t_f2h1ahurbkkqhh3pW9afC9o","lore_tm_v1_7pzm3ON2s2Ptrg6UZcFGlJhYfkAN1F42NgyfG_zsq-M","lore_tm_v1_yXn6UtJfzAM6UM62yryPBN4pTAOpww3xE6xTfWaHQAY","lore_tm_v1_JNsTK8Z0GFJa81OU2RfvsriMqRSo1MCQRJJlYT1zmJA","lore_tm_v1_ew9mWppcoTTzoWn32sETX1Sbv2IG7l7k64cIbqrx3ow","lore_tm_v1_CndPH1K9dTA3gsnaQoyXFaqsNoRzDx4uRnBBOiLfBFg","lore_tm_v1_mlnprOG0m1DvHEkm2z6F7w5F4YCu4yTBrOdUARMuhQk","lore_tm_v1_Xbzfaq2hVW-UTIC0IwCW-KjK8IIY-1sLsOZZa6kYgKA","lore_tm_v1_kf9LKii5Dxt6CTvVna-QVNWY-SmqaaJJIZmvjxNp9Ys","lore_tm_v1_t3UQllSogwyzkp6sJZzMfxHE01o6WayaGdvtaLunaG4","lore_tm_v1_Zpr94ih5sEGMWcJQNobhPjw-8H_sIsbD4rrALLxhUus","lore_tm_v1_8QkznrD5w5znoz5_106YnO9gwy5oQ_1arszdsAuwA8o","lore_tm_v1_JpAJzcbr1ShhNMSR-rFD3Cy_f3C_HAXPI_ELITJw61Y"]
Date: Sep 14, 2026
/home/byk/Code/opencode: always run bun typecheck from package directories such as packages/opencode; never run tsc directly.sdk-next composes Client, Core, and Server.import { foo as bar } from "..." and renamed imports such as resolve as pathResolve.import * as Foo from "..." and import type * as Foo from "..."; when namespace-style access is needed, import the module’s own named namespace export, e.g. import { Project } from "@opencode-ai/core/project" and use Project.ID.do-not-run-tests-from-root guard; run tests from package directories such as packages/opencode.packages/opencode: do not use export namespace Foo { ... }; use flat top-level exports plus a self-reexport such as export * as Foo from "./foo", or export * as Foo from "." when the file is a single-namespace directory’s index.ts.src/session/ and src/config/ should keep each module in its own file with its own self-reexport and should not add a barrel index.ts; consumers import specific siblings such as @/session/retry and @/session/status.bun dev from packages/opencode starts the interactive TUI; when inspection is needed, start it with tmux new-session -d -s opencode-dev 'bun dev', inspect via tmux capture-pane -pt opencode-dev, and stop via tmux kill-session -t opencode-dev.dev; use dev or origin/dev for diffs because local main may not exist; branch names must contain at most three hyphen-separated words without slash/type prefixes; commits and PR titles use type(scope): summary with valid types feat, fix, docs, chore, refactor, and test../packages/sdk/js/script/build.ts; after changing the public Protocol or Server HttpApi, run bun run generate from packages/client; do not directly edit src/generated or src/generated-effect.packages/opencode/src/session/status.ts defines SessionStatus.Service; its state is created with Effect.succeed(new Map<SessionID, Info>()), get(sessionID) defaults to { type: "idle" }, and set(...) manages status entries, indicating process-memory status rather than durable persisted busy state.packages/opencode/src/session/prompt.ts imports SessionStatus and sets busy at line 1089; packages/opencode/src/session/processor.ts sets idle at lines 626 and 638 and busy at line 653; packages/opencode/src/session/run-state.ts sets idle at lines 62 and 82, busy through onBusy at line 64, detects existing?.busy at line 74, and maps RunnerBusy via busyError(sessionID) at line 104.packages/opencode/src/session/prompt.ts: SessionPrompt.cancel at line 152, SessionPrompt.prompt at line 1053, and SessionPrompt.loop at line 1343. Importers found in packages/opencode/src/effect/app-runtime.ts, packages/opencode/src/control-plane/workspace.ts, packages/opencode/src/cli/cmd/github.handler.ts, packages/opencode/src/server/routes/instance/httpapi/server.ts, packages/opencode/src/server/routes/instance/httpapi/handlers/session.ts, and packages/opencode/src/server/routes/instance/httpapi/groups/session.ts.packages/opencode/src/cli/cmd/serve.ts: ServeCommand uses effectCmd, has instance: false, dynamically imports { Server } from ../../server/server, warns when Flag.OPENCODE_SERVER_PASSWORD is unset, resolves network options with resolveNetworkOptions(args), starts listening through Server.listen(opts), logs opencode server listening on http://${server.hostname}:${server.port}, and then blocks on Effect.never; the entrypoint contains no explicit session-recovery hook.Server.listen(...) startup call sites found: packages/opencode/src/cli/tui/worker.ts lines 28 and 56, packages/opencode/src/cli/cmd/acp.ts line 25, and packages/opencode/src/cli/cmd/web.ts line 44.packages/opencode/src/server/routes/instance/httpapi/server.ts imports SessionPrompt at line 35 and includes SessionPrompt.node at line 246; packages/opencode/src/server/routes/instance/httpapi/handlers/session.ts yields SessionPrompt.Service as promptSvc at line 52; packages/opencode/src/server/routes/instance/httpapi/groups/session.ts derives PromptPayload, CommandPayload, and ShellPayload from SessionPrompt.PromptInput, SessionPrompt.CommandInput, and SessionPrompt.ShellInput at lines 70–72.llm.stream(request) per provider turn; reload projected history before durable continuation; do not bridge through legacy SessionPrompt.loop(...); SessionRunCoordinator is process-local, joins explicit same-Session resumes, coalesces prompt wakeups, and allows different Sessions concurrently; advisory wakes drain eligible durable inbox rows, while post-crash continuation recovery requires a separate explicit design before retrying provider work; a drain has no durable identity or transcript boundary.