Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): delegated completions wait behind a parent usage limit #41896

Openjuliusmarmingewants to merge 2 commits intomain fromrefs/pull/41896/headopened View on GitHub

Showing 2 changed files with 184 additions and 10 deletions.

x
0 of 2 viewed, 2 left
144 additions and 0 deletionsapps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.tsModified
View file
@@ -6161,4 +6161,148 @@
assert.notEqual(finished?.completionDelivery?.state, "disposed");
+​
+ it.effect(
+ "queues a delegated completion behind a usage-limited parent run so armed auto-resume stays intact",
+ () =>
+ Effect.gen(function* () {
+ const orchestrator = yield* Orchestrator.OrchestratorV2;
+ const eventSink = yield* EventSink.EventSinkV2;
+ const now = yield* DateTime.now;
+ const resetAt = DateTime.formatIso(DateTime.add(now, { minutes: 10 }));
+ const threadId = ThreadId.make("thread:delegated-limit-parent");
+ const projectId = ProjectId.make("project:delegated-limit");
+ const parentRunId = RunId.make("run:delegated-limit-parent");
+ const rootNodeId = NodeId.make("node:delegated-limit-parent");
+ const taskId = NodeId.make("node:delegated-limit-task");
+ const wakeMessageId = MessageId.make("message:delegated-limit-wake");
+​
+ yield* seedParentWithTerminalTask({
+ threadId,
+ projectId,
+ runId: parentRunId,
+ rootNodeId,
+ taskId,
+ deliveryState: "claimed",
+ deliveryTaskIds: [taskId],
+ now,
+ });