Dashboard › opencode › Distillation
bdd84c07-e599-4b9f-8109-ae2af605859f["lore_tm_v1_t74zZXgsPGgH5Gds5itwEvaHfyZImRV6V0HhkGeqS4M","lore_tm_v1_2kn3DBWAxh3_ctNBzOvxuhz25aHth0ju_3urDOF6bGg","lore_tm_v1_ssuto6kB2qCpYjQVt8NqCk_XyoBgm79pVQ2l4SQJslw","lore_tm_v1_WILLJssy98eID3Vdux1aegs36KMaxhcSghYHOFJ7NIU","lore_tm_v1_nVzLKQGDppHmis39qB8SOUJztk3H1A1ybN3ZoBX_t7U","lore_tm_v1_Kw4KcFw-L2oK31-BH9e0cUKqglmLxG6JZdYVGAEf0GU","lore_tm_v1_G4jL7DRYUkrD1msQMm_YpxaczlD_bvxnnEjp_pCMXg0","lore_tm_v1_LwLCAun8N-2yUuEvQXIMUVeoecICWn9L9Sq2YO5095M","lore_tm_v1_lfWvbLLNJ8hvvl7fpIArR2elZjS4MiNl89vKBkpNfVY","lore_tm_v1_Di6y4qGBJkHBUbtFEflWSfFnW8XT2CtMyGo3_xTPtQQ","lore_tm_v1_YrOqmynEAs5nZgHORmDTbXTJo-6mUj14GEUnScw1onw","lore_tm_v1_PeaJVXk4y88Q6Q43ktc1CMxR3km6V71vZFSLHOOwISM","lore_tm_v1_HqlSW1P07bhcOOK9EcakM1SIMGfFeZRAVaNlrU9hGUo","lore_tm_v1_HS2BKEaJiYejdTlpeQ2hi0pnfsWj3O84exMmsAgRfe8","lore_tm_v1_dPAI3S_ijvJMeBaiIBOaW8iCJdm7XinE0s0hoQL18gM","lore_tm_v1_o32er-3PQS9JpKwW56Od7FAwMdvaOoJxFNndAn5hNHc","lore_tm_v1_cZvwdJMKS2zrNaj629dBHYMJSvBQsC8FHMrlGqd59Vs","lore_tm_v1_hTBBZ3vtcQoG-DnhgWiA6XiEUv1SWYs-rpDPWsR2htY","lore_tm_v1_CTqFLR-Pn-vYRWYpJW48AhsKu0joOfqKihaaa1OzkO8"]
Date: Sep 16, 2026
/tmp/opencode/session-recovery-final-v6.patch has SHA-256 a5c1bace440d1b6acb383c4fcffc52714a9373892e75b4f23bdbbf2dfdad8e16./home/byk/Code/opencode/packages/opencode/dist/server/opencode-server has SHA-256 d09c992a0f4cce15e73dd158fe60413420109c821afed6e121d11cdad9c7b583.ab9408c81cc9916177641ae8e9f08624fc27b5b9, with parent 2e9407768d1401a25b69febb36657638a779053a; tree/object identifier shown as d3323b963b9ef2de41a7ff9884299c74b93886ba, timestamp 1789377773, subject feat(app): adapt vertical tab density.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/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.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, packages/core/src/session/execution/claim.ts, and packages/core/src/session/recovery-id.ts.packages/core/schema.json +518/-47; 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/local.ts +135/-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.ts +331/-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 +244/-95; packages/core/src/session/runner/publish-llm-event.ts +76/-29; packages/core/src/session/sql.ts +68/-1; packages/core/test/database-migration.test.ts +66/-1; packages/core/test/session-execution-local.test.ts +283/-0; packages/core/test/session-projector.test.ts +1780/-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 +46/-7; packages/core/test/session-runner.test.ts +742/-17; 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/core/src/session/execution/claim.ts +66/-0; packages/core/src/session/recovery-id.ts +6/-0.packages/core/src/database/migration/20260914170650_session-recovery.ts, packages/core/src/session/recovery.ts, packages/core/test/session-execution-local.test.ts, packages/core/src/session/execution/claim.ts, and packages/core/src/session/recovery-id.ts./tmp/opencode/session-recovery-review.1VQHG0; /tmp/opencode existed with owner/group byk:byk, permissions drwxr-xr-x, size 4096, and modification time Sep 16 13:19.in_progress, high priority); 2. Trace execution claims, coordinator cleanup, interruption, provider failure, and tool reconciliation (pending, high priority); 3. Trace recovery selection, promotion, replay, scheduling, fairness, and retry invariants (pending, high priority); 4. Audit migration, generated artifacts, API layering, and all changed tests (pending, high priority); 5. Reconcile findings against supplied validation and issue final merge verdict (pending, high priority).ab9408c81cc9916177641ae8e9f08624fc27b5b9, and adds 5 files; review then moved to the two prior blockers through claim ownership, coordinator finalization, runner scope teardown, and tool settlement.packages/core/schema.json changes schema ID from f14a9b18-8207-487e-a3d3-227e629ba9ad to ec4e81da-4921-4488-85cd-745c52ddce17, makes the former ID the sole prevIds entry, and adds tables session_execution and session_recovery. Shown session_execution columns include non-null text id, non-null text session_id, non-null text owner_id, and nullable text assistant_message_id.packages/core/src/session/execution/claim.ts defines SessionExecutionClaim.Claim with sessionID, executionID, and ownerID; Lost errors identify the lost executionID; claim matching requires session_id, id, and owner_id equality plus expires_at > now.SessionExecutionClaim.update() renews expires_at to now + SESSION_EXECUTION_LEASE_MS, optionally updates assistant_message_id and phase, and dies with SessionExecutionClaim.Lost if no current matching claim is updated. SessionExecutionClaim.clear() applies the same live-claim fence when deleting and also dies with Lost if nothing is deleted. SessionExecutionClaim.transaction() uses an immediate database transaction and renews the claim before running the supplied effect.packages/core/src/session/execution/local.ts currently implements current-process routing for implicit-local Locations and identifies future remote placement as belonging there. It generates one process-local ownerID via crypto.randomUUID(), tracks claims in activeClaims: Map<SessionSchema.ID, SessionExecutionClaim.Claim>, and generates a new executionID for each drain.SessionExecutionTable values id, session_id, owner_id, phase: "ready", time_created: now, and expires_at: now + leaseDuration, using .onConflictDoNothing(); if insertion returns no row, the drain exits without running.packages/core/src/session/execution/local.ts filters SessionRecoveryTable by matching session_id, wake_pending = true, and recovery_error IS NULL; it orders by ascending time_created and then ascending execution_id, limits to 1 row, and passes its continuation_message_id to input.run().input.run(claim, force, recovery?.continuationMessageID) against periodic SessionExecutionClaim.update(db, claim) renewal using Schedule.spaced(Duration.millis(leaseDuration / 3)).activeClaims entry is removed. Successful execution clears the claim. Interrupt-only failure leaves it intact. Other failures reload the row and clear it only when its phase is neither "unknown" nor "continue".leaseDuration / 3, interrupts the coordinator, and then clears the claim. A SessionExecutionClaim.Lost during cleanup is tolerated only if no current execution row remains for that session; if a row still exists, the defect is rethrown.active: coordinator.active, resume: coordinator.run, and wake: coordinator.wake; its runner loads the session, dies with Session not found: ${claim.sessionID} if absent, and invokes runner.run({ ...claim, force, recoveryInputID }) under the location-specific service layer.packages/core/src/session/run-coordinator.ts serializes execution per key while permitting different keys concurrently. Its Coordinator<Key, E> exposes active, run, wake, and interrupt; each entry tracks done, optional owner, optional exit, pendingWake, and stopping.run(key) starts with force = true only while idle, otherwise joins the active execution; wake(key) coalesces follow-up work by setting pendingWake, or starts a non-forced execution when idle; a successful execution with pendingWake immediately starts a non-forced successor; failed execution with pending work replaces the entry and starts a successor.stopping, clears the then-current pendingWake, interrupts its owner fiber, runs optional cleanup, and then either removes the entry or starts a successor for work that arrived while stopping. It throws Interrupted Session execution did not settle if the interrupted entry did not record an exit, and propagates cleanup failure after coordinator state settlement.packages/core/src/session/runner/publish-llm-event.ts validates event ordering and identity, including errors for tool input end/delta before start, tool name changes, duplicate tool-input starts/ends, duplicate tool calls/results/errors, tool result/error before call, and unknown tool calls.publish-llm-event.ts persists one provider turn without executing tools or starting a continuation turn. It tracks whether each tool was called, input-ended, provider-executed, and settled; unsettled tools can be failed, while hosted-only handling skips non-provider-executed tools.packages/core/src/session/runner/to-llm-message.ts parses pending tool input as JSON when possible and otherwise preserves the raw string. Completed/error tool results use provider result values when provider.executed === true and a result exists; otherwise they construct values from stored content, structured data, or error fields.