Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): skip shell refresh for streaming deltas #4009

ClosedChrrxs(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/4009/headopened View on GitHub

Showing 2 changed files with 139 additions and 1 deletion.

x
0 of 2 viewed, 2 left
132 additions and 0 deletionsapps/server/src/orchestration/Layers/ProjectionPipeline.test.tsModified
View file
@@ -175,6 +175,138 @@
});
​
+it.layer(
+ Layer.fresh(makeProjectionPipelinePrefixedTestLayer("t3-projection-streaming-shell-summary-")),
+)("OrchestrationProjectionPipeline", (it) => {
+ it.effect("does not rescan thread shell history for streaming assistant messages", () =>
+ Effect.gen(function* () {
+ const projectionPipeline = yield* OrchestrationProjectionPipeline;
+ const eventStore = yield* OrchestrationEventStore;
+ const sql = yield* SqlClient.SqlClient;
+ const threadId = ThreadId.make("thread-streaming-shell-summary");
+ const messageId = MessageId.make("message-streaming-shell-summary");
+ const createdAt = "2026-01-01T00:00:00.000Z";
+ const deltaAt = "2026-01-01T00:00:01.000Z";
+ const appendAndProject = (event: Parameters<typeof eventStore.append>[0]) =>
+ eventStore
+ .append(event)
+ .pipe(Effect.flatMap((savedEvent) => projectionPipeline.projectEvent(savedEvent)));
+​
+ yield* appendAndProject({
+ type: "project.created",
+ eventId: EventId.make("evt-streaming-shell-summary-1"),
+ aggregateKind: "project",
+ aggregateId: ProjectId.make("project-streaming-shell-summary"),
+ occurredAt: createdAt,
+ commandId: CommandId.make("cmd-streaming-shell-summary-1"),
+ causationEventId: null,
+ correlationId: CorrelationId.make("cmd-streaming-shell-summary-1"),