Dashboard › opencode › Distillation
da05b238-ef5c-49ec-a7f3-a2e67fa2057f["lore_tm_v1_724HnUV7CX2rJtkDC53-bvUmKY91eW5V4Zfny6L9Kk4","lore_tm_v1_MIpchfgu_AhVDNKCyzgfFIcfp_Yz0rUjXKrNxfl0esY","lore_tm_v1_FQiiY5kres0kbz7x0p5cea0QLZ2khxYj_hkD-pr1G3A","lore_tm_v1_Zvq78BwjHUgvEoHJWLIQD-u0NFkl6ONFyaPP7Z0f8Rg","lore_tm_v1_vuiL-7FswZIPXoZPrk2o93P8HCbOSglVZCrSj_0AhlM","lore_tm_v1_aqk5Oyi53qi8pbcJiafuCTXpL0oJgE38KTLGMxV8HNk","lore_tm_v1_M2OFmdct3MSVy6Uw0NJHZFmK7ND19ak8cEA7XL2qDxM","lore_tm_v1_KkHzqzv6EvWp1DVLySsdFPQ2kEjYVnSC_b_oE3x_Et8","lore_tm_v1_O9w_4N8kNSfvfTlhDgOb0kp23liOUMsL_EhScZjtUuk","lore_tm_v1_v7tVzNmwqCS6mijAbooviVf3dSlO8sIa-gDlBqhOFQU","lore_tm_v1_OzEGXDpwzoD0krcIYADFwYzqXCOQNzS0ZhoXqRhF64Q","lore_tm_v1_OJdHtAB9bmGCRzFoe7CIV-A3rGagPSABLhBIWP2hq2U","lore_tm_v1_tLqawB9QRxQwyCpw5JoiOOVN8tTjVV7Gti84a15S2kM","lore_tm_v1_7aOfFIO4U7tTQ9a4flYBoBKh1f6HfS2e5zs0DGd4vEE"]
Date: Sep 17, 2026
/tmp/opencode/session-recovery-v22-review; prohibited editing, running tests/builds/services, mutating VCS/index/refs, and using recall.ab9408c81cc9916177641ae8e9f08624fc27b5b9; patch /tmp/opencode/session-recovery-final-v22.patch with SHA-256 5af96209cef23e735f09dbf2f4b2f5b0f51b208ece9e5b325e4e217b46003643; SEA /home/byk/Code/opencode/packages/opencode/dist/server/opencode-server with SHA-256 10a3698a5e3b009f811a1b27eefab9e1083b560e24efee5f537f003d7edd7384; expected scope 34 paths.session.next.step.interrupted.1 and leaves the session in cancelling with a running tool.Step.Failed cleanup publishes Tool.Failed after join, then clears state with the final atomic commit while retaining the original failure.continue.prevIds and explicit resume.file:line and a MUST-FIX or CONCERN classification, and required the final response to end exactly with MERGE or DO-NOT-MERGE./tmp/opencode/session-recovery-final-v22.patch SHA-256 was 5af96209cef23e735f09dbf2f4b2f5b0f51b208ece9e5b325e4e217b46003643, and /home/byk/Code/opencode/packages/opencode/dist/server/opencode-server SHA-256 was 10a3698a5e3b009f811a1b27eefab9e1083b560e24efee5f537f003d7edd7384.HEAD/base ab9408c81cc9916177641ae8e9f08624fc27b5b9, another reported revision 2e9407768d1401a25b69febb36657638a779053a, 29 tracked modified paths, 5 untracked paths, and therefore 34 changed paths total. A generated digest over the changed-path data was b1cb5991342a77eea7ded7b8369d827606ff6e9dc808a080490cc336d2d52117.packages/client/src/generated/types.ts; packages/core/schema.json; packages/core/src/database/migration.gen.ts; packages/core/src/database/migration/20260914170650_session-recovery.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/claim.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/recovery-id.ts; packages/core/src/session/recovery.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/core/test/database-migration.test.ts; 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; packages/opencode/src/server/routes/instance/httpapi/server.ts; packages/schema/src/session-event.ts; packages/schema/test/event-manifest.test.ts; packages/sdk/js/src/v2/gen/types.gen.ts; packages/sdk/openapi.json; packages/server/src/routes.ts.bun run generate from packages/client; src/generated and src/generated-effect must never be edited directly. The legacy JavaScript SDK is regenerated with ./packages/sdk/js/script/build.ts.sdk-next composes Client, Core, and Server.bun typecheck from package directories, such as packages/opencode, and never run tsc directly.import { foo as bar } from "..." and resolve as pathResolve.import * as Foo from "..." and import type * as Foo from "...".import { Project } from "@opencode-ai/core/project", then reference Project.ID; heavy branch-specific modules should use dynamic imports scoped to the narrowest needed branch.do-not-run-tests-from-root guard; tests must run from package directories such as packages/opencode.SessionV2.prompt(...) durably admits one session_input row before advisory SessionExecution.wake(sessionID), unless resume: false requests admit-only behavior; prompt message ID reuse reconciles only exact retries matching Session, prompt, and delivery mode.SessionExecution to remain process-global and Session-ID based; its local implementation owns the process-local Session coordinator, and V2 interruption targets the active process-local ownership chain, with idle or missing interruption being a no-op.llm.stream(request) call per provider turn, projected-history reload before durable continuation, and prohibit bridging through legacy SessionPrompt.loop(...) or delegating orchestration to an in-memory tool loop.SessionRunCoordinator joins explicit same-Session resumes, coalesces prompt wakeups, permits different Sessions concurrently, and that advisory wakes drain only eligible durable inbox rows; post-crash provider-work continuation requires a separate explicit design.queue inputs stay pending until the Session would otherwise become idle, one queued input is promoted at that boundary, and new user input resets the selected agent’s provider-turn allowance.@opencode-ai/schema to contain browser-safe serializable wire/storage contracts only, preserve @opencode-ai/schema <- @opencode-ai/protocol <- @opencode-ai/server, avoid runtime services and host-local details, keep V1-only events such as message.updated and message.part.* out of current Protocol/SDK Next unless explicitly required, and preserve a single canonical event definition.Schema.mutable(...) for runtime convenience, prefer Schema.Json for JSON-serializable values and Schema.Unknown for opaque values, avoid Schema.Any outside documented unsafe compatibility boundaries, and require focused contract/generated-surface tests.export namespace Foo { ... }; modules should expose flat top-level exports plus a namespace projection such as export * as Foo from "./foo" or export * as Foo from "." for index.ts.packages/core/src/session/execution/claim.ts found claim fencing by session_id, execution id, owner_id, and expires_at > now; the file documents node wall-clock leases and requires the lease interval to exceed maximum deployment clock skew plus one renewal interval.SessionExecutionClaim.update() in packages/core/src/session/execution/claim.ts:40-65 renews expires_at to now + SESSION_EXECUTION_LEASE_MS; transition to cancelled requires current phase cancelling, transition to cancelling excludes only current cancelled, and other updates exclude cancelling and cancelled. Missing updates die with SessionExecutionClaim.Lost.SessionExecutionClaim.renew() in packages/core/src/session/execution/claim.ts:67-82 renews only an unexpired fully matching claim; settleCancellation() at lines 84-98 requires phase cancelling; clear() at lines 100-109 deletes only an unexpired fully matching claim; all missing-row cases die with Lost.SessionExecutionClaim.transaction() in packages/core/src/session/execution/claim.ts:111-112 starts an immediate database transaction and performs update(db, claim) before the supplied effect.packages/core/src/session/recovery-id.ts deterministically creates fallback assistant IDs as msg_recovery_${executionID} and continuation IDs as msg_recovery_continue_${executionID}.packages/core/src/database/migration/20260914170650_session-recovery.ts has ID 20260914170650_session-recovery; it adds session_input.wake_pending defaulting to false and non-null, adds session.wake_attempts defaulting to 0 with range 0..9007199254740991, and creates session_execution and session_recovery.session_execution table uses primary key id, a unique index on session_id, fields owner_id, nullable assistant_message_id, phase, assistant_seq default -1, time_created, expires_at, and nullable recovery_error; valid phases are ready, safe, unknown, continue, cancelling, and cancelled; session_id references session(id) with ON DELETE CASCADE.session_recovery table uses primary key execution_id, fields session_id, nullable assistant_message_id, unique continuation_message_id, phase, wake_pending default true, wake_attempts default 0 with range 0..9007199254740991, nullable recovery_error, and time_created; foreign keys cascade from session, session_message, and session_input.session_execution_session_idx, session_execution_owner_idx, session_execution_recovery_scan_idx, session_input_wake_pending_promoted_session_idx, session_recovery_continuation_message_idx, and session_recovery_wake_pending_error_attempts_created_execution_idx.HttpApiBuilder.group(...); declared raw/WebSocket endpoints use handleRaw(...); raw HttpRouter.use(...) is reserved for routes outside the declared API surface; stable services/layers must be provided at application/layer construction rather than inside request handlers.