Dashboard › opencode › Distillation
882db897-b4fb-4ae7-9734-b199396811e5["lore_tm_v1_zCWzwqkffXXYBUhhRwrsae_4hllUBdvsnbcTyZoWClU"]
Date: Sep 15, 2026
/home/byk/Code/opencode/packages/core/src/session/input.ts:85-116 stores an admitted session input after checking SessionMessageTable for an existing row with the same input.id; an existing message causes Effect.die(new LifecycleConflict({ id: input.id })). It inserts into SessionInputTable with id, session_id, admitted_seq, prompt: encodePrompt(input.prompt), delivery, and epoch-millisecond time_created, using .onConflictDoNothing().returning({ id: SessionInputTable.id }).get().pipe(Effect.orDie); failure to store also causes LifecycleConflict./home/byk/Code/opencode/packages/core/src/session/input.ts:118-168 defines SessionInput.projectPrompted. It first updates the matching SessionInputTable row only when promoted_seq is null, setting it to input.promotedSeq; an updated row must satisfy matchesProjection(stored, input). If no row was updated, it calls find(db, input.id) and accepts an existing row only when both the projection matches and stored.promotedSeq === input.promotedSeq; otherwise it dies with LifecycleConflict. If no row exists, it inserts one with both admitted_seq and promoted_seq set to input.promotedSeq, plus the encoded prompt, delivery, session/message IDs, and epoch-millisecond creation time./home/byk/Code/opencode/packages/core/src/session/input.ts:170-179 begins SessionInput.hasPending(db, sessionID, delivery), querying SessionInputTable for an id under an and(...) predicate.