Dashboard › opencode › Distillation
2cc99ccc-61ca-4d28-9683-433efde99083["lore_tm_v1_r-C1S8GlLldXs56_wu_G3iMvpTT6ojrXBKFMZ4Qkqg0","lore_tm_v1_OYYqRSj1_WLA9Q2p8VyGed5Bm87uBYKhfyaweM18E0c","lore_tm_v1_-IrXI-JqDwqrnw7_3R06_a3u4TItFJyqqk0kZult6mk","lore_tm_v1_K5yTsKfp0mid-YCdgsKPMq0PBc51Dxl-Hcmq1o1IRUw","lore_tm_v1_FSW2yzi-TyuPOPA8UWmciKEZOul-Kv8H9_nNPzBmGso","lore_tm_v1_lM8lF-NpY10VuKK6WjyYTnUnQTdG0IBeoQ5kfBVpycU","lore_tm_v1_zUfm59HPGsPJLOAmVFegBaMUJdoafjVdMar3upzzfAo","lore_tm_v1_v6VHFnJRs1rVlvAYrugdsWDDwoXGbh3DWGRW8G2VVDY","lore_tm_v1_hI4wBqhRcOUC6z6rbhjmrzd0cmPHEjjYMX-Ik-z578E","lore_tm_v1_C3qJVuQKMu32W5MqxhfpWaVEhcqBh4UqjojI2FaKSKs"]
Date: Sep 16, 2026
in_progress, high priority); 2. Read applicable repository and package instructions without using mutable candidate source (pending, high); 3. Construct and fingerprint a disposable exact base+patch inspection tree outside VCS (pending, high); 4. Audit all 33 changed files and trace recovery security invariants end to end (pending, high); 5. Report severity-ordered findings with frozen file:line evidence and exact verdict (pending, high)./tmp/opencode/session-recovery-final-v4.patch had SHA-256 c2c8afb07a7b6a49c1d40c5515d718ad5a934c9291e80a068693259c26c566a0./home/byk/Code/opencode/packages/opencode/dist/server/opencode-server had SHA-256 56c1bc48b6e21397db05eb0d41f73d243a4b64da093fcfbe209baed65457f6e8.ab9408c81cc9916177641ae8e9f08624fc27b5b9, with parent/base-related hashes d3323b963b9ef2de41a7ff9884299c74b93886ba and 2e9407768d1401a25b69febb36657638a779053a, timestamp 1789377773, and subject feat(app): adapt vertical tab density.packages/core/schema.json 527/48; packages/core/src/database/migration.gen.ts 1/0; packages/core/src/database/migration/20260914170650_session-recovery.ts 55/0; packages/core/src/database/schema.gen.ts 45/0; packages/core/src/session.ts 5/4; packages/core/src/session/compaction.ts 31/16; packages/core/src/session/context-epoch.ts 54/34; packages/core/src/session/execution/claim.ts 66/0; packages/core/src/session/execution/local.ts 118/19; packages/core/src/session/input.ts 342/31; packages/core/src/session/message-updater.ts 69/0; packages/core/src/session/projector.ts 77/1; packages/core/src/session/recovery-id.ts 6/0; packages/core/src/session/recovery.ts 315/0; packages/core/src/session/run-coordinator.ts 30/5; packages/core/src/session/runner/index.ts 4/0; packages/core/src/session/runner/llm.ts 207/90; packages/core/src/session/runner/publish-llm-event.ts 74/28; packages/core/src/session/sql.ts 70/1; packages/core/test/database-migration.test.ts 63/1; packages/core/test/session-execution-local.test.ts 239/0; packages/core/test/session-projector.test.ts 1557/3; packages/core/test/session-prompt.test.ts 247/25; packages/core/test/session-run-coordinator.test.ts 45/0; packages/core/test/session-runner-recorded.test.ts 4/10; packages/core/test/session-runner-tool-events.test.ts 4/0; packages/core/test/session-runner.test.ts 584/16; packages/opencode/src/server/routes/instance/httpapi/server.ts 2/1; packages/schema/src/session-event.ts 43/1; packages/schema/test/event-manifest.test.ts 8/5; packages/sdk/js/src/v2/gen/types.gen.ts 190/0; packages/sdk/openapi.json 657/44; packages/server/src/routes.ts 2/0../packages/sdk/js/script/build.ts.HttpApi, run bun run generate from packages/client; never edit src/generated or src/generated-effect directly.sdk-next composes Client, Core, and Server.dev; local main may not exist, so diffs should use dev or origin/dev.feat/ or fix/; examples: session-recovery, fix-scroll-state, regenerate-sdk.type(scope): summary; valid types are feat, fix, docs, chore, refactor, and test, with optional affected-package scopes such as core, opencode, tui, app, desktop, sdk, or plugin.try/catch and any; use Bun APIs such as Bun.file() when possible; rely on type inference; prefer flatMap, filter, and map over loops; use filter type guards; and in Effect generators bind services to named variables rather than nested yields such as yield* (yield* Foo.Service).bar().src/config modules to follow the existing top-of-file self-export pattern, e.g. export * as ConfigAgent from "./agent".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 exported namespace by name, e.g. import { Project } from "@opencode-ai/core/project" and use Project.ID.await import("./module").then((mod) => mod.value()) or (await import("./module")).value().globalThis.* should only be used as a last resort. Tests should exercise actual implementation rather than duplicating implementation logic.do-not-run-tests-from-root guard; run tests from package directories such as packages/opencode.bun typecheck from package directories, e.g. packages/opencode; never run tsc directly.SessionV2.prompt(...) admits one durable session_input row before scheduling advisory SessionExecution.wake(sessionID), unless resume: false requests admit-only behavior; the serialized runner promotes admitted inputs into visible user messages at safe boundaries.src/system-context; Context Source producers stay with their observed domains; Session History selection and Context Epoch persistence remain Session-owned.@opencode-ai/schema owns browser-safe wire and storage contracts shared by protocol, server, core, and generated SDKs; runtime behavior, service layers, side effects, and host-local implementation details belong in the owning domain package.@opencode-ai/schema <- @opencode-ai/protocol <- @opencode-ai/server; Schema values must be serializable contract definitions rather than service implementations or runtime registries.Session, Permission, Question, Permission.Request), while retained compatibility/persistence/migration contracts are explicitly V1 (SessionV1, PermissionV1, PermissionV1.Request); V2 must not remain the permanent replacement-architecture name.src/v1/ after V1 isolation; new/current code must not depend on that subtree, and the subtree should be deleted when the legacy runtime retires.current, shared transitional, or V1-only before entering a public manifest. V1-only events such as message.updated and message.part.* must stay out of current Protocol/SDK Next unless a current-client requirement is documented; compatibility events should remain only on existing App/TUI/CLI compatibility surfaces.PluginID, PluginEvent, PtyInfo, PtyEvent, and SessionTodoInfo; preferred access uses canonical namespaces such as Plugin.ID and SessionTodo.Info.Schema.mutable(...) for public contracts; runtime mutation must be explicit via Types.DeepMutable, a purpose-built draft type, or another mutable API.create(); directional constructors such as ascending() or descending() remain only for public ordering semantics or compatibility. Generated ID schemas must validate exactly the emitted prefix, including _; legacy loose validators must not be tightened without an explicit compatibility/migration decision.undefined, no accidental current-contract Schema.Any, stable and unique public identifiers, exact facade/schema identity, and exclusion of V1-only events from current Protocol manifests.Schema.ErrorClass contracts. Built-in HttpApiError.* is acceptable only when its empty/tagged body is the intended wire shape; SDK-visible errors carrying messages should use a declared API error such as ApiNotFoundError. Domain/storage services must remain free of HttpApi types, with expected domain errors translated at handler boundaries.bun dev defaults to running OpenCode in packages/opencode; server debugging can use bun run --inspect=ws://localhost:6499/ --cwd packages/opencode ./src/index.ts serve --port 4096, with TUI attachment via opencode attach http://localhost:4096; TUI debugging can use bun run --inspect=ws://localhost:6499/ --cwd packages/opencode ./src/index.ts. bun dev spawn may be needed for server breakpoints because ordinary bun dev runs the server in a worker thread.