Dashboard › opencode › Distillation
66412c5c-59ab-4135-a09f-c0d31b6ac086["lore_tm_v1_MvDKLPXwT7_o2IL2eETr-DGZ2Pg3qBBebk_6PNa2XXQ","lore_tm_v1_zDcaoI2zaQeFSG_hKJiuQXpGlWaGOfeJ9Tx-b94X2dA","lore_tm_v1_e6_sw-awkUIwpzffct4CwgPjzV8kj7VhxQ1rFOTSDrU","lore_tm_v1_k2kHKxOD-FO3ABDmgGPNlZcGhlntgDleqxuCTrNtlnI","lore_tm_v1_QXQI87v0DOkS79EEtz73oOH2ebRNgdHf4WfRQPEPC70","lore_tm_v1_YJVTt6Nyqmk0BK41J1eVRyx7_WZy7rbwcIf1-zZ5GUY","lore_tm_v1_CZDsiW7QU4DQxAW-cD5ADp_rGbHbKwkBzz6aptc6BqU","lore_tm_v1_sN14PS2wMWNGXlkrMUGpdHA2ieAz8mXZtp_fnd6rp1I","lore_tm_v1_kRDRWZwh0PFDWh-tKAxh2zTZcNiTnLuNUk-6GnvPU_c"]
Date: Sep 14, 2026
packages/core/test/session-runner-tool-events.test.ts defines capture() around createLLMEventPublisher(...) with sessionID = SessionV2.ID.make("ses_tool_event_test"), agent "build", model ID "model", provider ID "provider", and no-op startCommit / terminalCommit callbacks using Effect.void.packages/core/test/session-runner-tool-events.test.ts uses tool call call-image for read({ path: "pixel.png" }) and a content result containing text "Image read successfully" plus pixel.png as data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB, with structured output { type: "media", mime: "image/png" }.local tool success serializes media base64 once and reconstructs from structured content verifies session.next.tool.success.1 contains the base64 exactly once, omits the compatibility result property, and retains reconstructed text/file content.provider-executed success retains its compatibility result when providerExecuted: true; binary failure emits no success event and emits session.next.tool.failed.1 for "Cannot read binary file"; old success event data containing result still decodes through SessionEvent.Tool.Success.data; and step finish records settlement without publishing step ended, where stepFinish({ index: 0, reason: "stop" }) leaves publisher.stepSettlement() with { finish: "stop" } and does not publish session.next.step.ended.2.packages/core/test/session-runner-tool-events.test.ts diff adds required publisher options startCommit: () => Effect.void and terminalCommit: () => Effect.void.packages/core/src/session/run-coordinator.ts exports SessionRunCoordinator and defines Coordinator<Key, E> with active, run(key), wake(key), and interrupt(key); executions are serialized per key while different keys may run concurrently.SessionRunCoordinator.make() stores active Entry<E> objects containing done, optional owner fiber, pendingWake, and stopping. run() starts a forced drain while idle or joins the active execution; wake() coalesces follow-up work; successful settlement starts a pending successor; interrupt() marks the entry stopping, clears pendingWake, and interrupts its owner fiber.dc661f30cb2055ad6248fdc59b14998d834497be, packages/core/src/session.ts:430-432 implements V2Session.interrupt as Effect.uninterruptible(execution.interrupt(sessionID)); packages/core/src/session/execution/local.ts:53 implements interruption as coordinator.interrupt(sessionID).pipe(Effect.andThen(clear(sessionID))); packages/server/src/handlers/session.ts:368 invokes session.interrupt(ctx.params.sessionID).packages/core/script/migration.ts uses packages/core/schema.json as the Drizzle snapshot, emits TypeScript migrations into packages/core/src/database/migration, regenerates packages/core/src/database/migration.gen.ts and packages/core/src/database/schema.gen.ts, and supports --check plus optional --name.bun drizzle-kit generate --config ${config} from packages/core, expects at most 1 incremental migration and exactly 1 full-schema migration, rejects an existing target migration, renders SQL statement breakpoints as yield* tx.run(...), formats generated TypeScript with Prettierβs typescript and estree plugins using semi: false and printWidth: 120, and removes its temporary directory in finally.bun script/migration.ts --check detects 3 stale/generated-artifact conditions with explicit remediation: ungenerated database migrations, stale packages/core/src/database/schema.gen.ts, or stale packages/core/src/database/migration.gen.ts; each directs running bun script/migration.ts from packages/core."7" and IDs f14a9b18-8207-487e-a3d3-227e629ba9ad (previous ID 169a0f0f-d58f-479f-b024-fa1c7b9a09db) and 57591e35-6f8f-4cda-932c-6a08e85caae7 (previous ID 9401e0ed-b1e3-4557-bc94-1c9b29e1e09c).packages/core/src/database/migration.ts serializes migration application with Semaphore.makeUnsafe(1). apply(db) applies pending migrations if a session table exists, dies with "Database is not empty and has no session table" for other nonempty databases, and for an empty database applies schema.up(tx), creates migration(id TEXT PRIMARY KEY, time_completed INTEGER NOT NULL), and records every known migration in one transaction.DatabaseMigration.applyOnly(db, input) creates the migration journal if absent, skips completed migration IDs, and applies each remaining migration plus its journal insert in a transaction.migration table from __drizzle_migrations: journals with a name column copy non-null names directly; unnamed journals derive %Y%m%d%H%M%S prefixes from created_at, match them against migration IDs, and die with Legacy migration timestamp ${entry.created_at} does not match any known migration when no match exists.dc661f30cb2055ad6248fdc59b14998d834497be, migration 20260303231226_add_workspace_fields.ts adds required text column workspace.type; 20260507164347_add_workspace_time.ts adds required integer workspace.time_used DEFAULT 0; and 20260603040000_session_message_projection_order.ts adds required integer session_message.seq.20260510033149_session_usage.ts adds required session usage columns with defaults: cost real DEFAULT 0, plus integer tokens_input, tokens_output, tokens_reasoning, tokens_cache_read, and tokens_cache_write, each DEFAULT 0 NOT NULL.20260605042240_add_context_epoch_agent.ts adds session_context_epoch.agent text DEFAULT 'build' NOT NULL; 20260914214636_session-execution.ts adds session_recovery.execution_id text NOT NULL; and 20260914222526_session-execution-phase.ts adds session_execution.phase text NOT NULL.packages/core/test/database-migration.test.ts exercises DatabaseMigration.applyOnly(...) with workspaceNameMigration, contextEpochAgentMigration, simplifyIntegrationCredentialsMigration, eventSourcedSessionInputMigration, simplifySessionInputMigration, sessionMessageProjectionOrderMigration, sessionUsageMigration, normalizeStoragePathsMigration, sessionMetadataMigration, and empty migration arrays; it also imports all generated migrations from @opencode-ai/core/database/migration.gen.dc661f30cb2055ad6248fdc59b14998d834497be reported fatal: path 'packages/opencode/dist/opencode-linux-x64/bin/opencode' exists on disk, but not in 'dc661f30cb2055ad6248fdc59b14998d834497be'.OK for 22 files spanning .lore.md, core schema/migrations/session implementation and tests, packages/opencode/src/server/routes/instance/httpapi/server.ts, packages/schema/src/session-event.ts, and packages/server/src/routes.ts; the resulting SHA-256 was e414f577c79eab2ae49be387b2f6fb48b013f9d8a61618d5298d62229bf8e4eb.