fix(server): drain queued native child continuations#21461
0 / 2 viewed2 files changedLine totals unavailable
apps/server/src/orchestration-v2/RunExecutionService.ts ยท Earlier revision 31b509ce ยท right 1343โ1345
Original diff
@@ -1331,6 +1339,12 @@ export const layer: Layer.Layer<
activeBackgroundTurnItems,
(current) => new Set([...current].filter((id) => !detached.itemIds.has(id))),
);
+ // Routing now rejects the moved thread's snapshots, so none would clear its entry.
+ for (const providerThreadId of pendingBackgroundWork.keys()) {
+ if (!routing.ownedProviderThreadIds.has(providerThreadId)) {
+ pendingBackgroundWork.delete(providerThreadId);apps/server/src/orchestration-v2/RunExecutionService.ts ยท right 1343โ1345