Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a delegated task waiting for an approval notifies its idle parent #35433

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

Showing 3 changed files with 128 additions and 10 deletions.

x
0 of 3 viewed, 3 left
28 additions and 9 deletionsapps/server/src/orchestration-v2/DelegatedTaskQuestionReactor.tsModified
View file
@@ -4,12 +4,14 @@
type OrchestrationV2DomainEvent,
type OrchestrationV2RuntimeRequest,
type OrchestrationV2Subagent,
+ ProviderRequestKind,
type RuntimeRequestId,
type ThreadId,
} from "@t3tools/contracts";
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
+import * as Schema from "effect/Schema";
import type * as Scope from "effect/Scope";
import * as Stream from "effect/Stream";
​
@@ -19,6 +21,10 @@
import * as Orchestrator from "./Orchestrator.ts";
import * as ProjectionStore from "./ProjectionStore.ts";
​
+const isApprovalKind = Schema.is(ProviderRequestKind);
+const notifiesParent = (kind: OrchestrationV2RuntimeRequest["kind"]) =>
+ kind === "user_input" || isApprovalKind(kind);
+​
export class DelegatedTaskQuestionReactor extends Context.Service<
DelegatedTaskQuestionReactor,
@@ -38,6 +44,9 @@
if (task.childThreadId === null) return;