History

fix: reconcile main's round-18 features after the rebase

Adopts the round's main features into the v2 architecture: the #9023 media rework (streamed videos, media-file assets, protocol-relative links), #9098 shared live-activity row folded into the v2 working and thinking rows, the #9084/#9078 Claude model catalog for v2 consumers, a native #9005 OpenCode child-session abort in the v2 adapter, #9013's landed LegendList patch, and per-environment sidebar provider entries. For #8600 the server-side pieces land, but auto-settle evaluation stays client-side (reading the new server-owned settings) until the v2 orchestrator grows its own settlement reactor; main's v1-only reactor and coalescer additions are dropped with the rest of the v1 path.

Julius Marminge committed 2 months ago

Commit 7b13bca1 parent 786a25847 files · +1855 −2616Browse files

Showing the changes to apps/server/src/persistence (2 of 47 files). Show all

Unified · Split

2 files
  1. apps/server/src/persistence/Layers/OrchestrationEventStore.ts +11 −10
  2. apps/server/src/persistence/Services/OrchestrationEventStore.ts +3 −2
apps/server/src/persistence/Layers/OrchestrationEventStore.ts+11−10
@@ -647,16 +647,17 @@ const makeEventStore = Effect.gen(function* () { · 646 unmodified lines
647647 const findEventAfter = SqlSchema.findOneOption({
648648 Request: HasEventAfterRequestSchema,
649649 Result: Schema.Struct({ sequence: Schema.Number }),
650− execute: (request) =>
651− sql`
652− SELECT sequence
653− FROM orchestration_events
654− WHERE aggregate_kind = ${request.aggregateKind}
655− AND stream_id = ${request.aggregateId}
656− AND event_type = ${request.type}
657− AND sequence > ${request.sequenceExclusive}
658− LIMIT 1
659− `,
650+ execute: (request) => sql`
651+ SELECT sequence
652+ FROM orchestration_events
653+ WHERE aggregate_kind = ${request.aggregateKind}
654+ AND stream_id = ${request.aggregateId}
655+ AND ${sql.and([
656+ sql`sequence > ${request.sequenceExclusive}`,
657+ ...(request.type === undefined ? [] : [sql`event_type = ${request.type}`]),
658+ ])}
659+ LIMIT 1
660+ `,
660661 });
661662
662663 const hasEventAfter: OrchestrationEventStoreShape["hasEventAfter"] = (input) =>
apps/server/src/persistence/Services/OrchestrationEventStore.ts+3−2
@@ -123,7 +123,8 @@ export interface OrchestrationEventStoreShape { · 122 unmodified lines
123123 readonly afterSequence?: number;
124124 }) => Stream.Stream<ApplicationStoredEvent, OrchestrationEventStoreError>;
125125 /**
126− * Check whether an aggregate has an event of the given type after a sequence.
126+ * Check whether an aggregate has an event after a sequence, optionally
127+ * restricted to one event type.
127128 *
128129 * Used during replay to tell whether a later event supersedes the one being
129130 * applied, without streaming the rest of the log.
@@ -131,7 +132,7 @@ export interface OrchestrationEventStoreShape { · 1 unmodified line
131132 readonly hasEventAfter: (input: {
132133 readonly aggregateKind: OrchestrationEvent["aggregateKind"];
133134 readonly aggregateId: string;
134− readonly type: OrchestrationEvent["type"];
135+ readonly type?: OrchestrationEvent["type"];
135136 readonly sequenceExclusive: number;
136137 }) => Effect.Effect<boolean, OrchestrationEventStoreError>;
137138 }