refactor(orchestration-v2): catch projection errors by tag

This commit is contained in:
Shivam Sharma authored and T3 Code Test committed 2026-08-14 15:04:11 +05:30
1 parent dedb92f627
commit 22e15a8423
1 file changed
+5 -7
@@ -165,13 +165,11 @@ export const layer: Layer.Layer<
(item) => item.type === "subagent" && item.subagentId === subagent.id,
);
if (turnItem === undefined) return [];
const childProjection = yield* projectionStore
.getThreadProjection(childThreadId)
.pipe(
Effect.catchIf(Schema.is(ProjectionStoreThreadNotFoundError), () =>
Effect.succeed(null),
),
);
const childProjection = yield* projectionStore.getThreadProjection(childThreadId).pipe(
Effect.catchTags({
ProjectionStoreThreadNotFoundError: () => Effect.succeed(null),
}),
);
if (childProjection === null) return [];
const childProviderThread = childProjection.providerThreads.find(
(candidate) => candidate.id === subagent.providerThreadId,