Dashboard › opencode › Session 0QA0mtdLs0Ko
0QA0mtdLs0KovTHZPRead-only adversarial correctness review frozen v15. Base ab9408c81cc9916177641ae8e9f08624fc27b5b9. Patch /tmp/opencode/session-recovery-final-v15.patch SHA-256 509563ba0cd17246a1d223ac7a6f3fabee1a49892c61b215c3fd7ca4744b6c77. SEA /home/byk/Code/opencode/packages/opencode/dist/server/opencode-server SHA-256 83a833aa93cc185825feffe107fba1bd8e3789d1ff5fe5f8cda7df1962aa078d. Verify exact inputs/base/clean apply/34 paths; inspect all. No mutation/tests/builds/services. v14 blockers: cancellation has durable cancelling->cancelled handshake; local finalizer never clears either phase; explicit coordinator cleanup clears cancelled, permits pre-assistant cancelling, rejects unresolved active cancelling; publication defect regression retains cancelling claim and running tool. Explicit Session.resume durably publishes PromptExecutionRequested for oldest unpromoted ordinary input before claim/run, so pre-promotion crash redrives exact input with no synthetic replacement. Current client regenerated through packages/client. Recovery scan covering index added. Reassess all lifecycle, replay, fairness, identity, tools, schema/client/dependency boundaries. Accepted final-check-to-call/process-local/skew residuals. Evidence recovery 247/0/730, full Core 1184/0/3319, six affected package typechecks, manifest/migration/diff, four-launch v15 smoke pass. Exact PASS/CONCERN/MUST-FIX with file:line; end MERGE or DO-NOT-MERGE. Empty invalid; no recall.
509563ba0cd17246a1d223ac7a6f3fabee1a49892c61b215c3fd7ca4744b6c77 /tmp/opencode/session-recovery-final-v15.patch 83a833aa93cc185825feffe107fba1bd8e3789d1ff5fe5f8cda7df1962aa078d /home/byk/Code/opencode/packages/opencode/dist/server/opencode-server
ab9408c81cc9916177641ae8e9f08624fc27b5b9 dc661f30cb2055ad6248fdc59b14998d834497be M .lore.md M AGENTS.md M packages/client/src/generated/types.ts M packages/core/schema.json M packages/core/src/database/migration.gen.ts M packages/core/src/database/migration/20260914170650_session-recovery.ts D packages/core/src/database/migration/20260914214636_session-execution.ts D packages/core/src/database/migration/20260914222526_session-execution-phase.ts M packages/core/src/database/schema.gen.ts M packages/core/src/session.ts M packages/core/src/session/compaction.ts M packages/core/src/session/context-epoch.ts M packages/core/src/session/execution/local.ts M packages/core/src/session/input.ts M packages/core/src/session/message-updater.ts M packages/core/src/session/projector.ts M packages/core/src/session/recovery.ts M packages/core/src/session/run-coordinator.ts M packages/core/src/session/runner/index.ts M packages/core/src/session/runner/llm.ts M ...
72 0 packages/client/src/generated/types.ts 567 48 packages/core/schema.json 1 0 packages/core/src/database/migration.gen.ts 62 0 packages/core/src/database/migration/20260914170650_session-recovery.ts 52 1 packages/core/src/database/schema.gen.ts 6 4 packages/core/src/session.ts 31 16 packages/core/src/session/compaction.ts 54 34 packages/core/src/session/context-epoch.ts 165 19 packages/core/src/session/execution/local.ts 391 31 packages/core/src/session/input.ts 69 0 packages/core/src/session/message-updater.ts 88 1 packages/core/src/session/projector.ts 504 0 packages/core/src/session/recovery.ts 30 5 packages/core/src/session/run-coordinator.ts 4 0 packages/core/src/session/runner/index.ts 294 104 packages/core/src/session/runner/llm.ts 89 37 packages/core/src/session/runner/publish-llm-event.ts 88 1 packages/core/src/session/sql.ts 66 1 packages/core/test/database-migration.test.ts 315 0 packages/core/test/session-execution-local.test.ts 2771 3 packages/core/test/session-projecto...
ab9408c81cc9916177641ae8e9f08624fc27b5b9 dc661f30cb (HEAD -> byk/cumulative) feat(core): recover interrupted sessions ab9408c81c feat(app): adapt vertical tab density 2e9407768d fix(server): bound Node shutdown 2c92569e62 fix(app): prevent stale WebUI asset loads b98c698390 feat(server): add Fossilize standalone builds .lore.md | 132 +++--- packages/core/schema.json | 444 ++++++++++++++++++--- packages/core/src/database/migration.gen.ts | 3 + .../migration/20260914170650_session-recovery.ts | 25 ++ .../migration/20260914214636_session-execution.ts | 26 ++ .../20260914222526_session-execution-phase.ts | 11 + packages/core/src/database/schema.gen.ts | 32 ++ packages/core/src/session/compaction.ts | 21 +- packages/core/src/session/execution/local.ts | 68 +++- packages/core/src/session/message-updater.ts | 46 +++ packages/core/src/session/projector.ts ...
(no output)
<path>/tmp/opencode/session-recovery-final-v15.patch</path>
<type>file</type>
<content>
1: diff --git a/packages/client/src/generated/types.ts b/packages/client/src/generated/types.ts
2: index 3b3188c874..5130fa9496 100644
3: --- a/packages/client/src/generated/types.ts
4: +++ b/packages/client/src/generated/types.ts
5: @@ -775,8 +775,17 @@ export type SessionsHistoryOutput = {
6: }>
7: }
8: readonly delivery: "steer" | "queue"
9: + readonly requestExecution?: boolean
10: }
11: }
12: + | {
13: + readonly id: string
14: + readonly metadata?: { readonly [x: string]: JsonValue }
15: + readonly type: "session.next.prompt.execution_requested"
16: + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number }
17: + readonly location?: { readonly directory: string; readonly workspaceID?: string }
18: + readonly data: { readonly timestamp: number; ...
<path>/tmp/opencode/session-recovery-final-v15.patch</path>
<type>file</type>
<content>
1563: + .where(and(eq(SessionMessageTable.session_id, sessionID), eq(SessionMessageTable.type, "assistant")))
1564: + .orderBy(desc(SessionMessageTable.seq))
1565: + .limit(1)
1566: + .get()
1567: + .pipe(Effect.orDie)
1568: + return yield* db
1569: + .insert(SessionExecutionTable)
1570: + .values({
1571: + id: executionID,
1572: + session_id: sessionID,
1573: + owner_id: ownerID,
1574: + phase: "ready",
1575: + assistant_seq: latest?.seq ?? -1,
1576: + time_created: now,
1577: + expires_at: now + leaseDuration,
1578: + })
1579: + .onConflictDoNothing()
1580: + .returning({ id: SessionExecutionTable.id })
1581: + ...
<path>/tmp/opencode/session-recovery-final-v15.patch</path>
<type>file</type>
<content>
2811: + { discard: true, concurrency: 1 },
2812: + )
2813: +
2814: + const retriedRecovery = yield* db
2815: + .select({
2816: + sessionID: SessionRecoveryTable.session_id,
2817: + executionID: SessionRecoveryTable.execution_id,
2818: + continuationMessageID: SessionRecoveryTable.continuation_message_id,
2819: + wakeAttempts: SessionRecoveryTable.wake_attempts,
2820: + })
2821: + .from(SessionRecoveryTable)
2822: + .where(
2823: + and(
2824: + eq(SessionRecoveryTable.wake_pending, true),
2825: + isNull(SessionRecoveryTable.recovery_error),
2826: + gt(SessionRecoveryTable.wake_attempts, 0),
2827: + lte(SessionRecoveryTable.wake_attempts, MAX_WAKE_ATTEMPTS),
2828: + ),
2829: + )
2830: + .orderBy(
2831: + desc(sql`${SessionRecoveryTable.wake_attempts} = ${MAX_WAKE_ATTEMPTS}`),
2832: + ...
<path>/tmp/opencode/session-recovery-final-v15.patch</path>
<type>file</type>
<content>
3947: + yield* publishEvent(SessionEvent.Tool.Called, {
3948: sessionID: input.sessionID,
3949: timestamp: yield* timestamp,
3950: assistantMessageID: tool.assistantMessageID,
3951: @@ -328,10 +375,13 @@ export const createLLMEventPublisher = (events: EventV2.Interface, input: Input)
3952: tool: event.name,
3953: input: record(event.input),
3954: provider: {
3955: - executed: tool.providerExecuted,
3956: + executed: providerExecuted,
3957: ...(event.providerMetadata === undefined ? {} : { metadata: event.providerMetadata }),
3958: },
3959: })
3960: + tool.called = true
3961: + tool.providerExecuted = providerExecuted
3962: + tool.providerMetadata = event.providerMetadata
3963: return
3964: }
3965: case "tool-result": {
3966: @@ ...
<path>/tmp/opencode/session-recovery-final-v15.patch</path>
<type>file</type>
<content>
5255: + (id, index) =>
5256: + events.publish(SessionEvent.Step.Recovered, {
5257: + sessionID: id,
5258: + timestamp: DateTime.makeUnsafe(index),
5259: + executionID: `poison-${index.toString().padStart(3, "0")}`,
5260: + phase: "ready",
5261: + }),
5262: + { discard: true, concurrency: 1 },
5263: + )
5264: + yield* db.run(sql`UPDATE session_input SET prompt = '{}' WHERE time_created < ${poisonCount}`)
5265: + const wakes: string[] = []
5266: + const execution = SessionExecution.Service.of({
5267: + ...recoveryExecution,
5268: + wake: (id) => Effect.sync(() => wakes.push(id)).pipe(Effect.asVoid),
5269: + })
5270: +
5271: + yield* SessionRecovery.recover().pipe(Effect.provideService(SessionExecution.Service, execution))
5272: + expect(wakes).toEqual([])
5273: + ...
<path>/tmp/opencode/session-recovery-final-v15.patch</path>
<type>file</type>
<content>
6682: + yield* SessionRecovery.recover().pipe(Effect.provideService(SessionExecution.Service, recoveryExecution))
6683: + expect(yield* db.select().from(SessionExecutionTable).get()).toMatchObject({
6684: + recovery_error: "Cancellation outcome unknown after owner loss",
6685: + })
6686: + }),
6687: + )
6688: +
6689: + it.effect("never quarantines cancellation after recovery ownership transfers", () =>
6690: + Effect.gen(function* () {
6691: + const { db } = yield* Database.Service
6692: + yield* db
6693: + .insert(ProjectTable)
6694: + .values({ id: Project.ID.global, worktree: AbsolutePath.make("/project"), sandboxes: [] })
6695: + .run()
6696: + yield* db
6697: + .insert(SessionTable)
6698: + .values({
6699: + id: sessionID,
6700: + project_id: Project.ID.global,
6701: + slug: "test",
6702: ...
<path>/tmp/opencode/session-recovery-final-v15.patch</path>
<type>file</type>
<content>
8073: + ? { type: "tool", id: fragmentID(kind, "partial"), state: { status: "error" } }
8074: + : fixture.expectedContent
8075: expect(yield* session.context(sessionID)).toMatchObject([
8076: { type: "user", text: prompt },
8077: {
8078: type: "assistant",
8079: finish: "error",
8080: error: { type: "unknown", message: "Provider unavailable" },
8081: - content: [fixture.expectedContent],
8082: + content: [expectedContent],
8083: },
8084: ])
8085: })
8086: @@ -536,15 +583,29 @@ const verifyPartialFlushOnInterruption = (kind: FragmentKind) =>
8087: )
8088:
8089: const runner = yield* SessionRunner.Service
8090: - const fiber = yield* runner.run({ sessionID, force: true }).pipe(Effect.forkChild)
8091: + yield* insertExecution(sessionID)
8092: + const fiber = yield* runner.run({ sessionID, ...
<path>/tmp/opencode/session-recovery-final-v15.patch</path>
<type>file</type>
<content>
9335: + .insert(SessionExecutionTable)
9336: + .values({
9337: + id: "replacement-during-finalizer",
9338: + session_id: sessionID,
9339: + owner_id: "replacement",
9340: + phase: "ready",
9341: + time_created: 0,
9342: + expires_at: 60_000,
9343: + })
9344: + .onConflictDoNothing()
9345: + .returning({ id: SessionExecutionTable.id })
9346: + .get()
9347: + .pipe(Effect.orDie),
9348: + ).toBeUndefined()
9349: +
9350: + yield* Deferred.succeed(releaseFinalizer, undefined)
9351: + yield* Fiber.join(interrupted)
9352: + expect(yield* Fiber.await(run)).toMatchObject({ _tag: "Failure" })
9353: + expect(yield* db.select().from(SessionExecutionTable).all()).toEqual([])
9354: + }),
9355: + )
9356: +
9357: it.effect("interrupts a blocked provider ...
<path>/tmp/opencode/session-recovery-final-v15.patch</path>
<type>file</type>
<content>
10912: +import type { Database } from "../../database/database"
10913: +import type { SessionSchema } from "../schema"
10914: +import { SESSION_EXECUTION_LEASE_MS, SessionExecutionTable } from "../sql"
10915: +
10916: +type DatabaseService = Database.Interface["db"]
10917: +
10918: +export type Claim = {
10919: + readonly sessionID: SessionSchema.ID
10920: + readonly executionID: string
10921: + readonly ownerID: string
10922: +}
10923: +
10924: +export type Values = Partial<
10925: + Pick<typeof SessionExecutionTable.$inferInsert, "assistant_message_id" | "assistant_seq" | "phase">
10926: +>
10927: +
10928: +export class Lost extends Error {
10929: + constructor(readonly claim: Claim) {
10930: + super(`Session execution claim lost: ${claim.executionID}`)
10931: + }
10932: +}
10933: +
10934: +const where = (claim: Claim, now: number) =>
10935: + and(
10936: + ...
/usr/bin/bash: line 1: python: command not found
verified 34 paths; old blob IDs match base and new blob IDs match reverse-applicable candidate
<path>/home/byk/Code/opencode/packages/core/src/session/execution/local.ts</path>
<type>file</type>
<content>
1: import { and, asc, desc, eq, isNull } from "drizzle-orm"
2: import { Cause, Clock, Duration, Effect, Exit, Layer, Schedule } from "effect"
3: import { Database } from "../../database/database"
4: import { LocationServiceMap } from "../../location-service-map"
5: import { makeGlobalNode } from "../../effect/app-node"
6: import { SessionRunCoordinator } from "../run-coordinator"
7: import { SessionRunner } from "../runner"
8: import { SessionMessage } from "../message"
9: import { SessionSchema } from "../schema"
10: import { SessionStore } from "../store"
11: import { SessionExecution } from "../execution"
12: import { SessionExecutionClaim } from "./claim"
13: import {
14: SESSION_EXECUTION_LEASE_MS,
15: SessionExecutionTable,
16: SessionMessageTable,
17: SessionRecoveryTable,
18: } from "../sql"
19:
20: /** Current-process routing for implicit-local Locations. ...
<path>/home/byk/Code/opencode/packages/core/src/session/recovery.ts</path>
<type>file</type>
<content>
1: export * as SessionRecovery from "./recovery"
2:
3: import { and, asc, desc, eq, exists, gt, isNull, lte, or, sql } from "drizzle-orm"
4: import { Clock, DateTime, Effect, Layer, Option, Schedule, Schema } from "effect"
5: import { Database } from "../database/database"
6: import { makeGlobalNode } from "../effect/app-node"
7: import { EventV2 } from "../event"
8: import { SessionEvent } from "./event"
9: import { SessionExecution } from "./execution"
10: import { SessionProjector } from "./projector"
11: import { SessionExecutionClaim } from "./execution/claim"
12: import { SessionInput } from "./input"
13: import { continuation } from "./recovery-id"
14: import { SessionSchema } from "./schema"
15: import {
16: MAX_WAKE_ATTEMPTS,
17: SESSION_EXECUTION_LEASE_MS,
18: SessionExecutionTable,
19: SessionInputTable,
20: SessionRecoveryTable,
21: SessionMessageTable,
22: ...
<path>/home/byk/Code/opencode/packages/core/src/session/input.ts</path>
<type>file</type>
<content>
1: export * as SessionInput from "./input"
2:
3: import { and, asc, desc, eq, isNull, lte } from "drizzle-orm"
4: import { DateTime, Effect, Option, Schema } from "effect"
5: import { Admitted, Delivery } from "@opencode-ai/schema/session-input"
6: import type { Database } from "../database/database"
7: import { EventV2 } from "../event"
8: import { SessionEvent } from "./event"
9: import { SessionMessage } from "./message"
10: import { Prompt } from "./prompt"
11: import { continuation, message } from "./recovery-id"
12: import { SessionSchema } from "./schema"
13: import { SessionInputTable, SessionMessageTable, SessionRecoveryTable, SessionTable } from "./sql"
14:
15: type DatabaseService = Database.Interface["db"]
16:
17: export { Admitted, Delivery }
18:
19: const decodePrompt = Schema.decodeUnknownSync(Prompt)
20: const encodePrompt = Schema.encodeSync(Prompt)
21: const ...
<path>/home/byk/Code/opencode/packages/core/src/session/input.ts</path>
<type>file</type>
<content>
621: commit(row).pipe(
622: Effect.andThen(
623: db
624: .update(SessionRecoveryTable)
625: .set({ recovery_error: defect.reason })
626: .where(
627: and(
628: eq(SessionRecoveryTable.execution_id, defect.executionID),
629: eq(SessionRecoveryTable.wake_pending, true),
630: isNull(SessionRecoveryTable.recovery_error),
631: ),
632: )
633: .returning({ executionID: SessionRecoveryTable.execution_id })
634: .get()
635: .pipe(Effect.orDie),
636: ),
637: ),
638: { behavior: "immediate" },
639: )
640: .pipe(
641: Effect.orDie,
642: ...
No files found
/home/byk/Code/opencode/packages/core/src/event.ts
Found 34 matches
/home/byk/Code/opencode/packages/core/src/event.ts:
Line 122: /** Local operational projection committed atomically with a new durable event. Not replayed or serialized. */
Line 123: readonly commit?: (seq: number) => Effect.Effect<void>
Line 127: readonly publish: <D extends Definition>(
Line 140: options?: { readonly publish?: boolean; readonly ownerID?: string; readonly strictOwner?: boolean },
Line 144: options?: { readonly publish?: boolean; readonly ownerID?: string; readonly strictOwner?: boolean },
Line 205: function commitDurableEvent(
Line 214: commit?: (seq: number) => Effect.Effect<void>,
Line 239: const committed = yield* db
Line 316: const committed = {
Line 321: yield* projector(committed)
Line 323: if (commit) yield* commit(seq)
Line 354: if (committed) {
Line 356: ...
<path>/home/byk/Code/opencode/packages/core/src/event.ts</path>
<type>file</type>
<content>
190: return created
191: })
192:
193: yield* Effect.addFinalizer(() =>
194: Effect.gen(function* () {
195: yield* PubSub.shutdown(pubsub.all)
196: yield* Effect.forEach(
197: pubsub.durable.values(),
198: (pubsubs) => Effect.forEach(pubsubs, PubSub.shutdown, { discard: true }),
199: { discard: true },
200: )
201: yield* Effect.forEach(pubsub.typed.values(), PubSub.shutdown, { discard: true })
202: }),
203: )
204:
205: function commitDurableEvent(
206: definition: Definition,
207: event: Payload,
208: input?: {
209: readonly seq: number
210: readonly aggregateID: string
211: readonly ownerID?: string
212: readonly strictOwner?: boolean
213: },
214: commit?: (seq: number) => ...
<path>/home/byk/Code/opencode/packages/core/src/session/runner/llm.ts</path>
<type>file</type>
<content>
100: const events = yield* EventV2.Service
101: const llm = yield* LLMClient.Service
102: const agents = yield* AgentV2.Service
103: const tools = yield* ToolRegistry.Service
104: const models = yield* SessionRunnerModel.Service
105: const store = yield* SessionStore.Service
106: const location = yield* Location.Service
107: const systemContext = yield* SystemContextRegistry.Service
108: const skillGuidance = yield* SkillGuidance.Service
109: const referenceGuidance = yield* ReferenceGuidance.Service
110: const config = yield* Config.Service
111: const snapshots = yield* Snapshot.Service
112: const db = (yield* Database.Service).db
113: const compaction = SessionCompaction.make({
114: events,
115: llm,
116: config: yield* config.entries(),
117: })
118: const getSession = ...
Found 34 matches /home/byk/Code/opencode/packages/client/src/generated/types.ts: Line 895: readonly type: "session.next.step.interrupted" Line 908: readonly type: "session.next.step.recovered" Line 1389: readonly type: "session.next.step.interrupted" Line 1402: readonly type: "session.next.step.recovered" /home/byk/Code/opencode/packages/sdk/openapi.json: Line 15312: "$ref": "#/components/schemas/EventSessionNextPromptExecution_requested" Line 18253: "enum": ["session.next.step.interrupted"] Line 18289: "enum": ["session.next.step.recovered"] Line 20580: "$ref": "#/components/schemas/SyncEventSessionNextPromptExecution_requested" Line 23814: "$ref": "#/components/schemas/SessionNextPromptExecution_requested" Line 24203: "$ref": "#/components/schemas/SessionNextPromptExecution_requested" Line 25724: ...
<path>/home/byk/Code/opencode/packages/server/src/routes.ts</path>
<type>file</type>
<content>
1: import { Database } from "@opencode-ai/core/database/database"
2: import { LayerNode } from "@opencode-ai/core/effect/layer-node"
3: import { httpClient } from "@opencode-ai/core/effect/app-node-platform"
4: import { AppNodeBuilder } from "@opencode-ai/core/effect/app-node-builder"
5: import { EventV2 } from "@opencode-ai/core/event"
6: import { Credential } from "@opencode-ai/core/credential"
7: import { PermissionSaved } from "@opencode-ai/core/permission/saved"
8: import { PtyTicket } from "@opencode-ai/core/pty/ticket"
9: import { SessionV2 } from "@opencode-ai/core/session"
10: import { SessionExecution } from "@opencode-ai/core/session/execution"
11: import { LocationServiceMap } from "@opencode-ai/core/location-service-map"
12: import { SessionExecutionLocal } from "@opencode-ai/core/session/execution/local"
13: import { SessionRecovery } from ...
<path>/home/byk/Code/opencode/packages/core/src/session/run-coordinator.ts</path>
<type>file</type>
<content>
1: export * as SessionRunCoordinator from "./run-coordinator"
2:
3: import { Deferred, Effect, Exit, Fiber, FiberSet, Scope } from "effect"
4:
5: /** Serializes execution for each key while allowing different keys to run concurrently. */
6: export interface Coordinator<Key, E> {
7: /** Snapshots keys with an execution owned by this coordinator. */
8: readonly active: Effect.Effect<ReadonlySet<Key>>
9: /** Starts execution while idle or joins the active execution. */
10: readonly run: (key: Key) => Effect.Effect<void, E>
11: /** Registers one coalesced follow-up after newly recorded work. */
12: readonly wake: (key: Key) => Effect.Effect<void>
13: /** Stops active execution, runs cleanup, then starts work that arrived while stopping. */
14: readonly interrupt: (key: Key, cleanup?: Effect.Effect<void>) => Effect.Effect<void>
15: }
16:
17: type Entry<E> = {
18: ...
<path>/home/byk/Code/opencode/packages/core/test/session-run-coordinator.test.ts</path>
<type>file</type>
<content>
250: const firstStarted = yield* Deferred.make<void>()
251: const cleanupStarted = yield* Deferred.make<void>()
252: const cleanupGate = yield* Deferred.make<void>()
253: const secondStarted = yield* Deferred.make<void>()
254: let runs = 0
255: const coordinator = yield* SessionRunCoordinator.make({
256: drain: () =>
257: Effect.sync(() => ++runs).pipe(
258: Effect.flatMap((run) =>
259: run === 1
260: ? Deferred.succeed(firstStarted, undefined).pipe(
261: Effect.andThen(Effect.never),
262: Effect.onInterrupt(() =>
263: Deferred.succeed(cleanupStarted, undefined).pipe(Effect.andThen(Deferred.await(cleanupGate))),
264: ),
265: )
266: ...
<path>/home/byk/Code/opencode/packages/core/src/session/execution/claim.ts</path>
<type>file</type>
<content>
1: export * as SessionExecutionClaim from "./claim"
2:
3: import { and, eq, gt } from "drizzle-orm"
4: import { Clock, Effect } from "effect"
5: import type { Database } from "../../database/database"
6: import type { SessionSchema } from "../schema"
7: import { SESSION_EXECUTION_LEASE_MS, SessionExecutionTable } from "../sql"
8:
9: type DatabaseService = Database.Interface["db"]
10:
11: export type Claim = {
12: readonly sessionID: SessionSchema.ID
13: readonly executionID: string
14: readonly ownerID: string
15: }
16:
17: export type Values = Partial<
18: Pick<typeof SessionExecutionTable.$inferInsert, "assistant_message_id" | "assistant_seq" | "phase">
19: >
20:
21: export class Lost extends Error {
22: constructor(readonly claim: Claim) {
23: super(`Session execution claim lost: ${claim.executionID}`)
24: }
25: }
26:
27: const where = (claim: Claim, ...
<path>/home/byk/Code/opencode/packages/core/src/session/projector.ts</path>
<type>file</type>
<content>
1: export * as SessionProjector from "./projector"
2:
3: import { and, desc, eq, gt, or, sql } from "drizzle-orm"
4: import { DateTime, Effect, Layer, Schema } from "effect"
5: import { Database } from "../database/database"
6: import { EventV2 } from "../event"
7: import { makeGlobalNode } from "../effect/app-node"
8: import { SessionEvent } from "./event"
9: import { SessionV1 } from "../v1/session"
10: import { WorkspaceTable } from "../control-plane/workspace.sql"
11: import { SessionMessage } from "./message"
12: import { SessionMessageUpdater } from "./message-updater"
13: import { SessionInput } from "./input"
14: import { Prompt } from "./prompt"
15: import { continuation } from "./recovery-id"
16: import { WorkspaceV2 } from "../workspace"
17: import {
18: MessageTable,
19: PartTable,
20: SessionInputTable,
21: SessionMessageTable,
22: SessionRecoveryTable,
23: ...
<path>/home/byk/Code/opencode/packages/core/src/session/projector.ts</path>
<type>file</type>
<content>
120: function run(db: DatabaseService, event: SessionEvent.Event) {
121: return Effect.gen(function* () {
122: const decodeRow = (row: typeof SessionMessageTable.$inferSelect) =>
123: decodeMessage({ ...row.data, id: row.id, type: row.type })
124: const updateMessage = (message: SessionMessage.Message) => {
125: if (event.durable === undefined) return Effect.die("Durable Session event is missing aggregate sequence")
126: const encoded = encodeMessage(message)
127: const { id, type, ...data } = encoded
128: return db
129: .update(SessionMessageTable)
130: .set({ type, time_created: DateTime.toEpochMillis(message.time.created), data })
131: .where(
132: and(
133: eq(SessionMessageTable.id, SessionMessage.ID.make(id)),
134: eq(SessionMessageTable.session_id, event.data.sessionID),
135: ...
<path>/home/byk/Code/opencode/packages/core/src/session/message-updater.ts</path>
<type>file</type>
<content>
1: import { castDraft, produce, type WritableDraft } from "immer"
2: import { Effect } from "effect"
3: import { SessionEvent } from "./event"
4: import { SessionMessage } from "./message"
5: import { message } from "./recovery-id"
6:
7: export type MemoryState = {
8: messages: SessionMessage.Message[]
9: }
10:
11: export interface Adapter {
12: readonly getCurrentAssistant: () => Effect.Effect<SessionMessage.Assistant | undefined>
13: readonly getAssistant: (messageID: SessionMessage.ID) => Effect.Effect<SessionMessage.Assistant | undefined>
14: readonly getCurrentShell: (callID: string) => Effect.Effect<SessionMessage.Shell | undefined>
15: readonly updateAssistant: (assistant: SessionMessage.Assistant) => Effect.Effect<void>
16: readonly updateShell: (shell: SessionMessage.Shell) => Effect.Effect<void>
17: readonly appendMessage: (message: ...
<path>/home/byk/Code/opencode/packages/core/src/session.ts</path>
<type>file</type>
<content>
340: return stored?.sessionID === input.sessionID ? stored.message : undefined
341: }),
342: context: Effect.fn("V2Session.context")(function* (sessionID) {
343: yield* result.get(sessionID)
344: return yield* store.context(sessionID)
345: }),
346: events: (input) =>
347: Stream.unwrap(
348: result
349: .get(input.sessionID)
350: .pipe(Effect.as(events.durable({ aggregateID: input.sessionID, after: input.after }))),
351: ).pipe(Stream.filter((event): event is SessionEvent.DurableEvent => isDurableSessionEvent(event))),
352: history: Effect.fn("V2Session.history")(function* (input) {
353: yield* result.get(input.sessionID)
354: return yield* EventV2.readAggregate(db, {
355: ...input,
356: aggregateID: input.sessionID,
357: manifest: ...
/home/byk/Code/opencode/packages/client/src/generated-effect/index.ts /home/byk/Code/opencode/packages/client/src/generated-effect/client.ts /home/byk/Code/opencode/packages/client/src/generated-effect/client-error.ts /home/byk/Code/opencode/packages/client/src/generated-effect/.httpapi-codegen.json
No files found
Found 10 matches /home/byk/Code/opencode/packages/opencode/test/session/prompt.test.ts: Line 732: LayerNode.compile(SessionV2.node, [ /home/byk/Code/opencode/packages/opencode/test/session/compaction.test.ts: Line 614: Effect.provide(AppNodeBuilder.build(SessionV2.node, [[SessionExecution.node, SessionExecution.noopLayer]])), /home/byk/Code/opencode/packages/server/src/routes.ts: Line 32: SessionV2.node, /home/byk/Code/opencode/packages/opencode/src/server/routes/instance/httpapi/server.ts: Line 300: AppNodeBuilderV1.build(LayerNode.group([SessionV2.node, SessionRecovery.node]), [ /home/byk/Code/opencode/packages/core/test/session-runner.test.ts: Line 277: SessionV2.node, /home/byk/Code/opencode/packages/core/test/session-projector.test.ts: Line 42: const sessionsLayer = AppNodeBuilder.build(SessionV2.node, [[SessionExecution.node, ...
{"id":"f14a9b18-8207-487e-a3d3-227e629ba9ad","prevIds":["169a0f0f-d58f-479f-b024-fa1c7b9a09db"]}
{"id":"57591e35-6f8f-4cda-932c-6a08e85caae7","prevIds":["9401e0ed-b1e3-4557-bc94-1c9b29e1e09c"]}
Found 2 matches /home/byk/Code/opencode/packages/core/schema.json: Line 5: "prevIds": [ /home/byk/Code/opencode/packages/core/script/migration.ts: Line 11: const snapshot = path.join(root, "packages/core/schema.json")
<path>/home/byk/Code/opencode/packages/core/script/migration.ts</path>
<type>file</type>
<content>
1: #!/usr/bin/env bun
2:
3: import { $ } from "bun"
4: import fs from "fs/promises"
5: import os from "os"
6: import path from "path"
7: import { pathToFileURL } from "url"
8: import { parseArgs } from "util"
9:
10: const root = path.resolve(import.meta.dirname, "../../..")
11: const snapshot = path.join(root, "packages/core/schema.json")
12: const tsDir = path.join(root, "packages/core/src/database/migration")
13: const registry = path.join(root, "packages/core/src/database/migration.gen.ts")
14: const schema = path.join(root, "packages/core/src/database/schema.gen.ts")
15: const args = parseArgs({
16: args: process.argv.slice(2),
17: options: {
18: check: { type: "boolean" },
19: name: { type: "string" },
20: },
21: })
22:
23: if (args.values.check) {
24: await check()
25: process.exit(0)
26: }
27:
28: await generate()
29:
30: async function generate() {
31: ...
dc661f30cb2055ad6248fdc59b14998d834497be 4d5efba5c9c60cb3ab5e89a5c4fc3675e3a591a4 c6ee511485bfb76fb89abfad2859463671f1cd3f 6c36b585c3595eab46345b6dbc3479b0004056c0 c2e6b18076676dce554f4765eca3ebf8fcc398c1 7793db3ac8a4898d7f1bccc2e3e6dbe587bb6f39
dc661f30cb2055ad6248fdc59b14998d834497be 57591e35-6f8f-4cda-932c-6a08e85caae7 9401e0ed-b1e3-4557-bc94-1c9b29e1e09c 4d5efba5c9c60cb3ab5e89a5c4fc3675e3a591a4 f14a9b18-8207-487e-a3d3-227e629ba9ad 169a0f0f-d58f-479f-b024-fa1c7b9a09db c6ee511485bfb76fb89abfad2859463671f1cd3f f14a9b18-8207-487e-a3d3-227e629ba9ad 169a0f0f-d58f-479f-b024-fa1c7b9a09db 6c36b585c3595eab46345b6dbc3479b0004056c0 169a0f0f-d58f-479f-b024-fa1c7b9a09db abd2f920-b822-49af-b8a7-2e48367d424f
No files found
No files found
No files found
No files found
<path>/home/byk/Code/opencode/node_modules</path> <type>directory</type> <entries> .bin/ .bun/ .cache/ .modules.yaml .pnpm-workspace-state-v1.json .pnpm/ @actions/ @aws-sdk/ @opencode-ai/ @tsconfig/ @types/ @typescript/ glob/ heap-snapshot-toolkit/ husky/ oxlint-tsgolint/ oxlint/ prettier/ semver/ sst/ turbo/ typescript/ (22 entries) </entries>
No files found
<path>/home/byk/Code/opencode/packages/core/node_modules</path> <type>directory</type> <entries> .bin/ @ai-sdk/ @aws-sdk/ @effect/ @ff-labs/ @lydell/ @npmcli/ @opencode-ai/ @openrouter/ @opentelemetry/ @parcel/ @silvia-odwyer/ @tsconfig/ @types/ ai-gateway-provider/ bun-pty/ cross-spawn/ diff/ drizzle-kit/ drizzle-orm/ effect/ fuzzysort/ gitlab-ai-provider/ glob/ google-auth-library/ gray-matter/ htmlparser2/ ignore/ immer/ jsonc-parser/ mime-types/ minimatch/ npm-package-arg/ semver/ turndown/ venice-ai-sdk-provider/ which/ xdg-basedir/ zod/ (39 entries) </entries>
/home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/index.mjs /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/dist-cjs-CBbOAgC5.js /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/promise-Du6d4fSq.js /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/signin-Buh2ql0x.js /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/diff-BHBkEJHk.js /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/sts-T1y5K8UP.js /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/brace-expansion-CQ04dhdS.js /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/connections-BUhsilZD.js /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/push-postgres-rfOlX-yB.js /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/chunk-D0pENJGy.js /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/dist-cjs-C1V3hN4z.js /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/views-CWLPzq9s.js /home/...
Found 21 matches
/home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/api-postgres.js:
Line 220: prevIds: [json.prevId],
Line 333: prevIds: obj.prevIds,
/home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/snapshot-CHMNRJxo.js:
Line 405: prevIds: require_types.arrayType(require_types.stringType())
Line 549: const toJsonSnapshot = (ddl, prevIds, renames) => {
Line 553: prevIds,
Line 564: prevIds: array((_) => true),
Line 576: prevIds: [],
/home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/utils-node-DWTi1mTL.js:
Line 2270: prevIds: require_types.arrayType(require_types.stringType())
Line 2354: prevIds: require_snapshot.array((_) => true),
Line 2362: prevIds: [],
Line 2426: prevIds: require_types.arrayType(require_types.stringType())
Line 2458: prevIds: require_snapshot.array((_) => true),
Line 2466: prevIds: [],
Line 3133: prevIds: require_snapshot.array((_) => true),
Line 3145: prevIds: ...
Found 1 matches /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/api-postgres.js: Line 371: return toJsonSnapshot(ddl, prevId ? [prevId] : [require_utils.originUUID], []);
<path>/home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/snapshot-CHMNRJxo.js</path>
<type>file</type>
<content>
530: schemas: require_types.recordType(require_types.stringType(), require_types.stringType())
531: }).strict();
532: const pgSchemaSquashed = require_types.objectType({
533: version: require_types.literalType("7"),
534: dialect: require_types.literalType("postgresql"),
535: tables: require_types.recordType(require_types.stringType(), tableSquashed),
536: enums: require_types.recordType(require_types.stringType(), enumSchema),
537: schemas: require_types.recordType(require_types.stringType(), require_types.stringType()),
538: views: require_types.recordType(require_types.stringType(), view),
539: sequences: require_types.recordType(require_types.stringType(), sequenceSquashed),
540: roles: require_types.recordType(require_types.stringType(), roleSchema).default({}),
541: policies: require_types.recordType(require_types.stringType(), ...
Found 1 matches /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/api-postgres.js: Line 333: prevIds: obj.prevIds,
Found 11 matches
/home/byk/Code/opencode/packages/core/src/session/compaction.ts:
Line 198: yield* dependencies.events.publish(
Line 233: yield* dependencies.events.publish(
/home/byk/Code/opencode/packages/core/src/session/todo.ts:
Line 56: yield* events.publish(Event.Updated, input)
/home/byk/Code/opencode/packages/core/src/session/context-epoch.ts:
Line 76: yield* events.publish(
/home/byk/Code/opencode/packages/core/src/session/revert.ts:
Line 90: yield* events.publish(SessionEvent.RevertEvent.Staged, {
Line 107: yield* events.publish(SessionEvent.RevertEvent.Cleared, {
Line 116: yield* events.publish(SessionEvent.RevertEvent.Committed, {
/home/byk/Code/opencode/packages/core/src/session/runner/llm.ts:
Line 135: yield* events.publish(
Line 477: events.publish(
/home/byk/Code/opencode/packages/core/src/session/runner/publish-llm-event.ts:
Line 66: ? events.publish(definition, data, { commit })
...
(no output)
Found 12 matches
/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
Line 652: expect(userTexts(request)).toEqual(["Session execution interrupted by server restart", "continue"])
Line 1576: expect(yield* db.select().from(SessionExecutionTable).get()).toMatchObject({ phase: "continue" })
Line 2269: phase: "continue",
Line 3535: it.effect("interrupts runner continuation when permission approval is declined", () =>
Line 3698: it.effect("interrupts runner continuation when a question is dismissed", () =>
/home/byk/Code/opencode/packages/core/test/session-projector.test.ts:
Line 246: phase: "continue",
Line 251: phase: "continue",
Line 532: phase: "continue",
Line 545: phase: "continue",
Line 1558: phase: "continue",
Line 1579: expect.objectContaining({ execution_id: "conflicting-recovery-identity", phase: "continue" }),
Line 1810: phase: "continue",
<path>/home/byk/Code/opencode/packages/core/test/session-runner.test.ts</path>
<type>file</type>
<content>
3510: LLMEvent.finish({ reason: "tool-calls" }),
3511: ],
3512: [
3513: LLMEvent.stepStart({ index: 0 }),
3514: LLMEvent.stepFinish({ index: 0, reason: "stop" }),
3515: LLMEvent.finish({ reason: "stop" }),
3516: ],
3517: ]
3518:
3519: yield* session.resume(sessionID)
3520:
3521: expect(requests).toHaveLength(2)
3522: expect(yield* session.context(sessionID)).toMatchObject([
3523: { type: "user", text: "Call blocked" },
3524: {
3525: type: "assistant",
3526: content: [
3527: { type: "tool", id: "call-blocked", state: { status: "error", error: { message: "Permission blocked" } } },
3528: ],
3529: },
3530: { type: "assistant", finish: "stop" },
3531: ])
3532: }),
3533: )
3534:
3535: it.effect("interrupts ...
<path>/home/byk/Code/opencode/packages/core/src/session/runner/publish-llm-event.ts</path>
<type>file</type>
<content>
50:
51: const settledOutput = (value: ToolOutput | undefined, result: ToolResultValue): SettledOutput => {
52: if (result.type === "error") return { error: { type: "unknown", message: message(result.value) } }
53: const settled = value ?? ToolOutput.fromResultValue(result)
54: if (!settled) throw new Error(`Unsupported tool result: ${message(result)}`)
55: return { structured: record(settled.structured), content: settled.content }
56: }
57:
58: /** Persist one provider turn without executing tools or starting a continuation turn. */
59: export const createLLMEventPublisher = (events: EventV2.Interface, input: Input) => {
60: const publishEvent = <D extends EventV2.Definition>(
61: definition: D,
62: data: EventV2.Data<D>,
63: commit: (seq: number) => Effect.Effect<void> = input.eventCommit,
64: ) =>
65: definition.durable !== ...
Resume the frozen v15 correctness review after the server restart. Do not use recall. Re-verify or continue from your existing immutable evidence and return the required substantive PASS/CONCERN/MUST-FIX report ending exactly MERGE or DO-NOT-MERGE. Note that this review is now advisory because source changed after v15; still complete the original exact-hash review.
sha256sum: /tmp/opencode/session-recovery-final-v15.patch: No such file or directory 83a833aa93cc185825feffe107fba1bd8e3789d1ff5fe5f8cda7df1962aa078d /home/byk/Code/opencode/packages/opencode/dist/server/opencode-server
Found 6 matches
/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
Line 3940: expect(yield* db.select().from(SessionExecutionTable).get()).toMatchObject({ phase: "cancelling" })
/home/byk/Code/opencode/packages/core/test/session-projector.test.ts:
Line 2041: owner_id: "cancelled-owner",
Line 2042: phase: "cancelling",
Line 2093: phase: "cancelling",
Line 2145: phase: "cancelling",
/home/byk/Code/opencode/packages/core/test/session-execution-local.test.ts:
Line 309: expect(yield* claims).toEqual([expect.objectContaining({ phase: "cancelling" })])
<path>/home/byk/Code/opencode/packages/core/src/session/projector.ts</path>
<type>file</type>
<content>
365: timeCreated: event.data.timestamp,
366: promotedSeq: event.durable.seq,
367: })
368: yield* run(db, event)
369: }),
370: )
371: yield* events.project(SessionEvent.PromptAdmitted, (event) =>
372: Effect.gen(function* () {
373: if (event.durable === undefined) return yield* Effect.die("Durable Session event is missing aggregate sequence")
374: yield* SessionInput.projectAdmitted(db, {
375: admittedSeq: event.durable.seq,
376: id: event.data.messageID,
377: sessionID: event.data.sessionID,
378: prompt: event.data.prompt,
379: delivery: event.data.delivery,
380: requestExecution: event.data.requestExecution ?? false,
381: timeCreated: event.data.timestamp,
382: })
383: }),
384: )
385: yield* ...
No files found
<path>/home/byk/Code/opencode/packages/core/src/session/message.ts</path> <type>file</type> <content> 1: export * as SessionMessage from "./message" 2: export * from "@opencode-ai/schema/session-message" (End of file - total 2 lines) </content>
Found 1 matches
/home/byk/Code/opencode/packages/schema/src/session-message.ts:
Line 12: export const ID = Schema.String.check(Schema.isStartsWith("msg_")).pipe(
<path>/home/byk/Code/opencode/packages/schema/src/session-message.ts</path>
<type>file</type>
<content>
1: export * as SessionMessage from "./session-message"
2:
3: import { Schema } from "effect"
4: import { optional } from "./schema"
5: import { ProviderMetadata, ToolContent } from "./llm"
6: import { Model } from "./model"
7: import { FileAttachment, Prompt } from "./prompt"
8: import { DateTimeUtcFromMillis, RelativePath, statics } from "./schema"
9: import { SessionID } from "./session-id"
10: import { ascending } from "./identifier"
11:
12: export const ID = Schema.String.check(Schema.isStartsWith("msg_")).pipe(
13: Schema.brand("Session.Message.ID"),
14: statics((schema) => ({ create: () => schema.make("msg_" + ascending()) })),
15: )
16: export type ID = typeof ID.Type
17:
18: export interface UnknownError extends Schema.Schema.Type<typeof UnknownError> {}
19: export const UnknownError = Schema.Struct({
20: type: Schema.Literal("unknown"),
21: message: ...
ab9408c81cc9916177641ae8e9f08624fc27b5b9 38 83a833aa93cc185825feffe107fba1bd8e3789d1ff5fe5f8cda7df1962aa078d /home/byk/Code/opencode/packages/opencode/dist/server/opencode-server
<path>/home/byk/Code/opencode/packages/core/schema.json</path>
<type>file</type>
<content>
1: {
2: "version": "7",
3: "dialect": "sqlite",
4: "id": "3bc49670-06d1-4eba-9a45-8c8128bdcf6f",
5: "prevIds": [
6: "d4ff43d2-c4f9-442c-bada-a7d488b42fd2"
7: ],
8: "ddl": [
9: {
10: "name": "workspace",
11: "entityType": "tables"
12: },
(Showing lines 1-12 of 2590. Use offset=13 to continue.)
</content>
Found 3 matches /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/studio-CoS8Dl1j.js: Line 2021: dialect: "sqlite", Line 2043: dialect: "sqlite", /home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/utils-node-DWTi1mTL.js: Line 4025: dialect: "sqlite",
<path>/home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/studio-CoS8Dl1j.js</path>
<type>file</type>
<content>
2000: return {
2001: dbHash: (0, crypto$1.createHash)("sha256").update(dbUrl).digest("hex"),
2002: dialect: "mysql",
2003: packageName,
2004: databaseName: database,
2005: proxy,
2006: transactionProxy,
2007: benchmarkProxy,
2008: customDefaults,
2009: schema: mysqlSchema,
2010: relations,
2011: schemaFiles
2012: };
2013: };
2014: const drizzleForSQLite = async (credentials, sqliteSchema, relations, schemaFiles) => {
2015: const customDefaults = getCustomDefaults(sqliteSchema);
2016: if ("driver" in credentials && credentials.driver === "d1") {
2017: const { connectToD1 } = await Promise.resolve().then(() => require("./connections-BUhsilZD.js"));
2018: const sqliteDB = await connectToD1(credentials.binding);
2019: return {
2020: dbHash: (0, crypto$1.createHash)("sha256").update("d1://binding").digest("hex"),
2021: dialect: ...
Found 5 matches /home/byk/Code/opencode/packages/core/test/session-runner.test.ts: Line 415: yield* db.delete(SessionMessageTable).where(eq(SessionMessageTable.session_id, id)).run().pipe(Effect.orDie) /home/byk/Code/opencode/packages/core/test/session-projector.test.ts: Line 159: yield* db.delete(SessionMessageTable).where(eq(SessionMessageTable.session_id, sessionID)).run() Line 198: yield* db.delete(SessionMessageTable).where(eq(SessionMessageTable.session_id, sessionID)).run() /home/byk/Code/opencode/packages/core/test/session-prompt.test.ts: Line 114: yield* db.delete(SessionMessageTable).where(eq(SessionMessageTable.session_id, sessionID)).run().pipe(Effect.orDie) /home/byk/Code/opencode/packages/core/src/session/projector.ts: Line 515: .delete(SessionMessageTable)
<path>/home/byk/Code/opencode/packages/core/src/session/projector.ts</path>
<type>file</type>
<content>
490: .pipe(Effect.orDie, Effect.asVoid),
491: )
492: yield* events.project(SessionEvent.RevertEvent.Cleared, (event) =>
493: db
494: .update(SessionTable)
495: .set({ revert: null, time_updated: DateTime.toEpochMillis(event.data.timestamp) })
496: .where(eq(SessionTable.id, event.data.sessionID))
497: .run()
498: .pipe(Effect.orDie, Effect.asVoid),
499: )
500: yield* events.project(SessionEvent.RevertEvent.Committed, (event) =>
501: Effect.gen(function* () {
502: const boundary = yield* db
503: .select({ seq: SessionMessageTable.seq })
504: .from(SessionMessageTable)
505: .where(
506: and(
507: eq(SessionMessageTable.session_id, event.data.sessionID),
508: eq(SessionMessageTable.id, event.data.messageID),
509: ),
510: ...
Found 10 matches
/home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/utils-D9CsqMfV.js:
Line 3: const originUUID = "00000000-0000-0000-0000-000000000000";
Line 204: Object.defineProperty(exports, 'originUUID', {
Line 207: return originUUID;
/home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/api-postgres.js:
Line 371: return toJsonSnapshot(ddl, prevId ? [prevId] : [require_utils.originUUID], []);
/home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/snapshot-CHMNRJxo.js:
Line 575: id: require_utils.originUUID,
/home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/utils-node-DWTi1mTL.js:
Line 2361: id: require_utils.originUUID,
Line 2465: id: require_utils.originUUID,
Line 3144: id: require_utils.originUUID,
Line 3834: id: require_utils.originUUID,
Line 4026: id: require_utils.originUUID,
Found 8 matches
/home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/dist-cjs-DP1dfP1V.js:
Line 4111: jti: crypto.randomUUID(),
/home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/dist-cjs-DJqjr70i.js:
Line 3077: //#region ../node_modules/.pnpm/@smithy+uuid@1.1.0/node_modules/@smithy/uuid/dist-cjs/randomUUID.js
Line 3078: var require_randomUUID = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
Line 3080: exports.randomUUID = void 0;
Line 3082: exports.randomUUID = crypto_1.default.randomUUID.bind(crypto_1.default);
Line 3088: var randomUUID = require_randomUUID();
Line 3091: if (randomUUID.randomUUID) return randomUUID.randomUUID();
/home/byk/Code/opencode/packages/core/node_modules/drizzle-kit/snapshot-CHMNRJxo.js:
Line 552: id: (0, crypto.randomUUID)(),
No files found
<path>/home/byk/Code/opencode/packages/core/test/session-execution-local.test.ts</path>
<type>file</type>
<content>
230: expect((yield* claims)[0]?.expires_at).toBe(0)
231: }),
232: )
233:
234: it.effect("settles cancellation before starting a pending successor", () =>
235: Effect.gen(function* () {
236: yield* insertSession
237: const firstStarted = Deferred.makeUnsafe<void>()
238: const finalizerStarted = Deferred.makeUnsafe<void>()
239: const releaseFinalizer = Deferred.makeUnsafe<void>()
240: const successorStarted = Deferred.makeUnsafe<void>()
241: let runs = 0
242: const execution = yield* SessionExecutionLocal.make({
243: run: () =>
244: Effect.sync(() => ++runs).pipe(
245: Effect.flatMap((run) =>
246: run === 1
247: ? Deferred.succeed(firstStarted, undefined).pipe(Effect.andThen(Effect.never))
248: : Deferred.succeed(successorStarted, ...
Before the restart, I verified:
509563ba0cd17246a1d223ac7a6f3fabee1a49892c61b215c3fd7ca4744b6c7783a833aa93cc185825feffe107fba1bd8e3789d1ff5fe5f8cda7df1962aa078dab9408c81cc9916177641ae8e9f08624fc27b5b9git apply --reverse --check succeeded.After the restart, the patch file no longer exists. The SEA still matches its stated hash. This report therefore continues from the verified immutable evidence and applies only to frozen v15. I ran no tests, builds, or services.
SessionExecutionClaim.update fences only by Session, execution, owner, and unexpired lease. It never checks the expected phase (packages/core/src/session/execution/claim.ts:27-33, packages/core/src/session/execution/claim.ts:40-58).
The interrupt path first commits phase = "cancelling" (packages/core/src/session/execution/local.ts:128-161). However, an already uninterruptible durable publication can subsequently call the same unrestricted update and write safe or continue while committing Step.Ended (packages/core/src/session/runner/llm.ts:477-495).
A concrete ordering is:
Step.Ended publication.interrupt commits cancelling.safe or continue.safe, the local finalizer clears the claim (packages/core/src/session/execution/local.ts:97-120).packages/core/src/session/execution/local.ts:137-155). ...Date: Sep 16, 2026 * 🟡 (22:00) The patch adds an `insertExecution(sessionID)` call. * 🟡 (22:00) The patch represents an unsettled provider step with `error: { type: "unknown", message: "Provider Step ended without settlement" }`. * 🟡 (22:00) The `"session.next.prompt.admitted"` event data includes `assistantMessageID: SessionMessage.ID`. * 🟡 (22:00) The patch adds `Step.Interrupted` to the re…
Date: Sep 16, 2026 * 🔴 [enforced-concurrency-safety] (22:00) User asserted the system must “never dispatch a provider after ownership changes.” * 🔴 [enforced-concurrency-safety] (22:00) User asserted the system must “never publish streamed output after ownership changes.” * 🔴 [enforced-concurrency-safety] (22:00) User asserted the system must “never start a local tool after ownership changes.”…
Date: Sep 16, 2026 * 🔴 [enforced-concurrency-safety] (21:59) User asserted recovery handling must “never quarantine cancellation after recovery ownership transfers.” * 🔴 [enforced-concurrency-safety] (21:59) User asserted recovery handling must “never quarantine projection failure after recovery ownership expires.” * 🔴 [enforced-concurrency-safety] (21:59) User asserted recovery handling must …
Date: Sep 16, 2026 * 🔴 [enforced-concurrency-safety] (21:59) User asserted the session execution system must “never wake work settled between selection and redrive CAS.” * 🔴 [enforced-concurrency-safety] (21:59) User asserted recovery must “never recover a pre-promotion claim when input commits at the recovery boundary.” * 🔴 [enforced-concurrency-safety] (21:59) User asserted the scanner must …
Date: Sep 16, 2026 * 🔴 [enforced-concurrency-safety] (21:59) User asserted the session execution system must “never start a second owner while the lease is live.” * 🔴 [enforced-concurrency-safety] (21:59) User asserted the session execution system must “never overwrite an expired lease.” * 🔴 [enforced-concurrency-safety] (21:59) User asserted the session execution system must “never re-enter i…
Date: Sep 16, 2026 * 🟡 (21:58) User supplied another patch excerpt showing recovery-row selection ordered by `asc(SessionRecoveryTable.wake_attempts)`. * 🟡 (21:58) The patch excerpt showed recovery eligibility filtering with `isNull(SessionRecoveryTable.recovery_error)`. * 🟡 (21:58) The patch excerpt joined recovery continuations via `.leftJoin(SessionRecoveryTable, eq(SessionRecoveryTable.con…
Date: Sep 16, 2026 * 🟡 (21:58) User supplied a further partial patch excerpt showing Effect error-handling constructs `Effect.orDie`, `Effect.tapCause((cause) => ...)`, and `Effect.catchDefect((defect) => ...)`. * 🟡 (21:58) The patch excerpt showed recovery phase guards involving `"unknown"` and `"continue"`, including `if (current && current.phase !== "unknown" && current.phase !== "continue")…
Date: Sep 16, 2026 * 🟡 (21:58) User supplied an additional partial patch/file excerpt for the frozen v15 review; visible generated type additions included `readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number }`. * 🟡 (21:58) The supplied schema excerpt visibly referenced the `session_recovery` table, `owner_id` and `wake_attempts` columns, foreign ke…
Date: Sep 16, 2026 * 🔴 [requested-review] (21:55) User requested a read-only adversarial correctness review of frozen v15, using base commit `ab9408c81cc9916177641ae8e9f08624fc27b5b9`, patch `/tmp/opencode/session-recovery-final-v15.patch` with SHA-256 `509563ba0cd17246a1d223ac7a6f3fabee1a49892c61b215c3fd7ca4744b6c77`, and SEA `/home/byk/Code/opencode/packages/opencode/dist/server/opencode-serve…