Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): run provider commands in per-thread lanes #13617

Closedsimplificando-roberto(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/13617/headopened View on GitHub

Showing 3 changed files with 133 additions and 7 deletions (loading 1).

x
0 of 3 viewed, 3 left
41 additions and 6 deletionsapps/server/src/orchestration/Layers/ProviderCommandReactor.tsModified
View file
@@ -18,6 +18,7 @@
import { isTemporaryWorktreeBranch, WORKTREE_BRANCH_PREFIX } from "@t3tools/shared/git";
import * as Cache from "effect/Cache";
import * as Cause from "effect/Cause";
+import * as Config from "effect/Config";
import * as Crypto from "effect/Crypto";
import * as DateTime from "effect/DateTime";
import * as Deferred from "effect/Deferred";
@@ -30,8 +31,9 @@
import * as Path from "effect/Path";
import * as Schedule from "effect/Schedule";
import * as Schema from "effect/Schema";
+import * as Semaphore from "effect/Semaphore";
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";
@@ -119,6 +121,8 @@
​
const HANDLED_TURN_START_KEY_MAX = 10_000;
const HANDLED_TURN_START_KEY_TTL = Duration.minutes(30);
+const DEFAULT_PROVIDER_COMMAND_LANES = 16;
+const DEFAULT_PROVIDER_SESSION_START_CONCURRENCY = 4;
const DEFAULT_RUNTIME_MODE: RuntimeMode = "full-access";
​
function providerErrorLabel(value: string | undefined): string {