Dashboard › opencode › Distillation
14b9fedb-1091-47c5-845d-edbd5c0817a8["lore_tm_v1_kRmYGCMmofFkbIk0_8Hh_Bf8Z81h5ClSdpQNjh59qJI","lore_tm_v1_xvj4KnxguAPQUWvwpj6ozIsMfv2oDNGjqQ1AOPth730","lore_tm_v1_9Fs3-DOmDKjFILEVwTBD3PZ9iQAaLVYkBkhUW3lwARE","lore_tm_v1_vNvnL_WQAQtvFX0HWj43HqZCn3GVCLzTwUbITdGg6Ok","lore_tm_v1_WjuMNwZHKTCc9MHFeGlOJ9OB6ZYYQjrTNwKWkyZtBzQ","lore_tm_v1_DvB1n3HxNjCJTnTY0c-DtEVcs4FwOvfa-GHjWmZRLl0","lore_tm_v1_r7vjqZWbpjZf7EPKWUK5QRoUfh1PP8pOxulpj4Bwq7Q","lore_tm_v1_11gctdEG4-BMn0BRsZLFcbQeOhsvn4hq_horZgRpakQ","lore_tm_v1_xfWiG-1aLTpiAZXbdq6sRM7YdYMwq81--CJPnj9og9E"]
Date: Sep 16, 2026
.jj/: use jj rather than git for mutations; never use interactive flags (-i, --interactive) or jj resolve; always pass -m "msg" when describing/committing; verify mutations with jj st and jj log; prefer stable letter-based change IDs over hexadecimal commit IDs; never rebase or describe immutable commits; use jj undo, jj op log, or jj op restore <op-id> for recovery.jj st, resolved by manually editing conflict markers, and confirmed cleared with another jj st.@, its parent is @-, file edits automatically amend @, and there is no staging area, git add, or stash.jj bookmark set or jj bookmark move.x..y means set difference while x::y means a DAG path, and these revsets are not interchangeable./tmp/opencode/session-recovery-final-v6.patch with SHA-256 a5c1bace440d1b6acb383c4fcffc52714a9373892e75b4f23bdbbf2dfdad8e16./home/byk/Code/opencode/packages/opencode/dist/server/opencode-server with SHA-256 d09c992a0f4cce15e73dd158fe60413420109c821afed6e121d11cdad9c7b583.ab9408c81cc9916177641ae8e9f08624fc27b5b9, 2e9407768d1401a25b69febb36657638a779053a, d3323b963b9ef2de41a7ff9884299c74b93886ba, timestamp 1789377773, description feat(app): adapt vertical tab density, and ancestry_exit=0./tmp/opencode/session-recovery-final-v6.patch contains session-recovery changes across 33 files, including new files packages/core/src/database/migration/20260914170650_session-recovery.ts, packages/core/src/session/recovery.ts, packages/core/src/session/execution/claim.ts, and packages/core/src/session/recovery-id.ts.packages/core/schema.json, packages/core/src/database/migration.gen.ts, packages/core/src/database/schema.gen.ts, packages/core/src/session.ts, packages/core/src/session/compaction.ts, packages/core/src/session/context-epoch.ts, packages/core/src/session/execution/local.ts, packages/core/src/session/input.ts, packages/core/src/session/message-updater.ts, packages/core/src/session/projector.ts, packages/core/src/session/run-coordinator.ts, packages/core/src/session/runner/index.ts, packages/core/src/session/runner/llm.ts, packages/core/src/session/runner/publish-llm-event.ts, packages/core/src/session/sql.ts, packages/opencode/src/server/routes/instance/httpapi/server.ts, packages/schema/src/session-event.ts, packages/sdk/js/src/v2/gen/types.gen.ts, packages/sdk/openapi.json, and packages/server/src/routes.ts.packages/core/test/database-migration.test.ts, new packages/core/test/session-execution-local.test.ts, packages/core/test/session-projector.test.ts, packages/core/test/session-prompt.test.ts, packages/core/test/session-run-coordinator.test.ts, packages/core/test/session-runner-recorded.test.ts, packages/core/test/session-runner-tool-events.test.ts, packages/core/test/session-runner.test.ts, and packages/schema/test/event-manifest.test.ts.bun install and bun dev../packages/opencode/script/build.ts --single and run as ./packages/opencode/dist/opencode-<platform>/bin/opencode.<platform> with the actual platform, for example darwin-arm64 or linux-x64.bun dev <directory> starts the TUI against a specified directory, bun dev . targets the OpenCode repository root, bun dev serve starts the headless API server on port 4096 by default, and bun dev serve --port 8080 uses port 8080.bun run --cwd packages/app dev, normally at http://localhost:5173, with the OpenCode server running for full functionality../script/generate.ts after API or SDK changes such as changes to packages/opencode/src/server/server.ts.Fixes #123 or Closes #123; UI PRs should include before/after screenshots or videos; logic changes must explain verification and reproduction; descriptions should be short and focused rather than AI-generated walls of text.else; prefer .catch(...) over try/catch; use precise types and avoid any; favor immutable patterns and avoid let; use concise descriptive single-word names; use Bun helpers such as Bun.file() when suitable.@opencode-ai/core is version 1.18.30, is private and ESM ("type": "module"), uses bun test --only-failures for test, tsgo --noEmit for typecheck, and exports ./session/runner from ./src/session/runner/index.ts.packages/schema/AGENTS.md, packages/opencode/AGENTS.md, packages/opencode/src/server/routes/instance/httpapi/AGENTS.md, packages/core/src/tool/AGENTS.md, packages/app/AGENTS.md, and packages/desktop/AGENTS.md.@opencode-ai/schema owns browser-safe wire and storage contracts; runtime behavior, service layers, side effects, and host-local implementation details stay in the owning domain package.@opencode-ai/schema <- @opencode-ai/protocol <- @opencode-ai/server; current contracts are unversioned, retained legacy contracts are explicitly V1, and V2 must not remain the permanent name for replacement architecture contracts.message.updated and message.part.* should remain outside the current Protocol/SDK Next event surface unless a current-client requirement is documented, and there must be one canonical event definition rather than duplicates for generation convenience.export * as SessionMessage from "./session-message"; bridge aliases such as PluginID, PluginEvent, PtyInfo, PtyEvent, and SessionTodoInfo should be avoided.optional(...) helper so encoded objects omit undefined; raw Schema.optional(...) is only for intentionally preserved, documented undefined properties; convenience defaults should normally use Schema.withDecodingDefault(...).Schema.mutable(...), should use Schema.Json for JSON-serializable values and Schema.Unknown for opaque values, and should avoid Schema.Any except at explicitly unsafe documented compatibility boundaries.create(), generated ID schemas must validate the exact emitted prefix including the underscore, and public schema identifiers/brands must be unique and stable.undefined properties, absence of accidental current-contract Schema.Any, stable and unique public identifiers, exact facade/schema identity, and exclusion of V1-only events from current Protocol manifests.HttpApiBuilder.group(...); SSE handlers should return HttpServerResponse.stream(...) and annotate success with HttpApiSchema.asText({ contentType: "text/event-stream" }).HttpApiBuilder.group(...) with handleRaw(...); raw HttpRouter.use(...) is reserved for routes outside the declared API surface such as catch-all UI fallbacks.Effect.provide(SomeLayer) inside request handlers and avoid HttpRouter.provideRequest(...) unless a dependency is intentionally request-level.Schema.ErrorClass endpoint contracts; SDK-visible errors requiring messages should use an exact declared API error such as ApiNotFoundError; domain/storage services should remain free of HttpApi types, with expected errors translated at the handler boundary.packages/core/src/**/*.sql.ts, while migrations live in packages/core and are applied by core.bun dev process in tmux rather than as a blocking foreground process: start with tmux new-session -d -s opencode-dev 'bun dev', inspect with tmux capture-pane -pt opencode-dev, and stop with tmux kill-session -t opencode-dev.export namespace Foo { ... }; modules should expose flat top-level exports and a self-reexport such as export * as Foo from "./foo", or export * as Foo from "." in a single-namespace index.ts.src/session/ and src/config/ should not gain barrel index.ts files; consumers should import specific siblings such as @/session/retry or @/session/status.Effect.gen(function* () { ... }); use Effect.fn("Domain.method") for named/traced effects and Effect.fnUntraced for internal helpers; use Effect.callback for callback APIs; use Effect.void instead of Effect.succeed(undefined); prefer DateTime.nowAsDate when a Date is needed.Schema.Class for multi-field data, Schema.brand for single-value types, Schema.TaggedErrorClass for typed errors, Schema.Defect for defect-like causes, and direct yield* new MyError(...) for early failures instead of yield* Effect.fail(new MyError(...)).makeRuntime from src/effect/run-service.ts; per-directory/project state should use InstanceState from src/effect/instance-state.ts, with cleanup via Effect.addFinalizer or Effect.acquireRelease and scoped background consumers via Effect.forkScoped.Effect.fork or Effect.forkDaemon; use Effect.forkIn(scope).FileSystem.FileSystem, ChildProcessSpawner.ChildProcessSpawner with ChildProcess.make(...), HttpClient.HttpClient, Path.Path, Config, Clock, and DateTime over ad hoc platform APIs.Effect.cached rather than manually storing Fiber | undefined or Promise | undefined.@parcel/watcher, node-pty, native fs.watch, and plugin callbacks should use EffectBridge when re-entering Effect services with instance/workspace context; plain async code should pass explicit context or remain inside an Effect fiber rather than using ambient instance-context shims.