Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
[codex] migrate Effect.fn in apps/server/src/orchestration/Layers/ProviderCommandReactor.ts (#1629)
Julius Marmingeb9c7ea0581e1
diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.tsindex d4f13ec72..8e2a19bcd 100644--- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts+++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts@@ -724,39 +724,40 @@ const make = Effect.gen(function* () {});});- const processDomainEvent = (event: ProviderIntentEvent) =>- Effect.gen(function* () {- switch (event.type) {- case "thread.runtime-mode-set": {- const thread = yield* resolveThread(event.payload.threadId);- if (!thread?.session || thread.session.status === "stopped") {- return;- }- const cachedModelSelection = threadModelSelections.get(event.payload.threadId);- yield* ensureSessionForThread(- event.payload.threadId,- event.occurredAt,- cachedModelSelection !== undefined ? { modelSelection: cachedModelSelection } : {},- );+ const processDomainEvent = Effect.fn("processDomainEvent")(function* (+ event: ProviderIntentEvent,+ ) {+ switch (event.type) {+ case "thread.runtime-mode-set": {+ const thread = yield* resolveThread(event.payload.threadId);+ if (!thread?.session || thread.session.status === "stopped") {return;}- case "thread.turn-start-requested":- yield* processTurnStartRequested(event);- return;- case "thread.turn-interrupt-requested":- yield* processTurnInterruptRequested(event);- return;- case "thread.approval-response-requested":- yield* processApprovalResponseRequested(event);- return;- case "thread.user-input-response-requested":- yield* processUserInputResponseRequested(event);- return;- case "thread.session-stop-requested":- yield* processSessionStopRequested(event);- return;+ const cachedModelSelection = threadModelSelections.get(event.payload.threadId);+ yield* ensureSessionForThread(+ event.payload.threadId,+ event.occurredAt,+ cachedModelSelection !== undefined ? { modelSelection: cachedModelSelection } : {},+ );+ return;}- });+ case "thread.turn-start-requested":+ yield* processTurnStartRequested(event);+ return;+ case "thread.turn-interrupt-requested":+ yield* processTurnInterruptRequested(event);+ return;+ case "thread.approval-response-requested":+ yield* processApprovalResponseRequested(event);+ return;+ case "thread.user-input-response-requested":+ yield* processUserInputResponseRequested(event);+ return;+ case "thread.session-stop-requested":+ yield* processSessionStopRequested(event);+ return;+ }+ });const processDomainEventSafely = (event: ProviderIntentEvent) =>processDomainEvent(event).pipe(