Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): isolate provider command lanes by thread #9823

Closedlnieuwenhuis(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/9823/headopened View on GitHub

Showing 3 changed files with 202 additions and 4 deletions (loading 1).

x
0 of 3 viewed, 3 left
5 additions and 2 deletionsapps/server/src/orchestration/Layers/ProviderCommandReactor.tsModified
View file
@@ -27,7 +27,7 @@
import * as Schedule from "effect/Schedule";
import * as Schema from "effect/Schema";
import * as Stream from "effect/Stream";
-import { makeDrainableWorker } from "@t3tools/shared/DrainableWorker";
+import { makeDrainableWorker, makeKeyedDrainableWorker } from "@t3tools/shared/DrainableWorker";
​
import { resolveThreadWorkspaceCwd } from "../../checkpointing/Utils.ts";
import { increment, orchestrationEventsProcessedTotal } from "../../observability/Metrics.ts";
@@ -1772,7 +1772,10 @@
- const worker = yield* makeDrainableWorker(processDomainEventSafely);
+ const worker = yield* makeKeyedDrainableWorker(
+ (event: ProviderIntentEvent) => event.payload.threadId,
+ processDomainEventSafely,
+ );
const start: ProviderCommandReactorShape["start"] = Effect.fn("start")(function* () {
const interruptedTitleRegenerations = yield* findInterruptedThreadTitleRegenerations().pipe(
197 additions and 2 deletionspackages/shared/src/DrainableWorker.test.tsModified
View file
@@ -1,9 +1,9 @@
import { it } from "@effect/vitest";
-import { describe, expect } from "vite-plus/test";
+import { describe, expect, expectTypeOf } from "vite-plus/test";
import * as Deferred from "effect/Deferred";