Skip to content

Commit c2e3b7d

Browse files
committed
fix(server): keep the retry failure when the stall stop times out
1 parent 7be81d8 commit c2e3b7d

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

‎apps/server/src/orchestration-v2/ProviderSessionManager.ts‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,10 +2215,18 @@ export const layerWithOptions = (
22152215
if (providerThread === undefined || runningRetries.get(item.providerTurnId) !== item)
22162216
return;
22172217
stalledRetries.set(item.providerTurnId, item);
2218-
yield* entry.exposedRuntime.interruptTurn({
2219-
providerThread,
2220-
providerTurnId: item.providerTurnId,
2221-
});
2218+
yield* entry.exposedRuntime
2219+
.interruptTurn({ providerThread, providerTurnId: item.providerTurnId })
2220+
.pipe(
2221+
// A slow stop can still end the turn later, so that terminal keeps the retry failure.
2222+
Effect.catchTags({
2223+
ProviderAdapterInterruptTimeoutError: (cause) =>
2224+
Effect.logWarning("orchestration-v2.provider-retry-stall-stop-timed-out", {
2225+
providerSessionId: entry.runtime.providerSessionId,
2226+
cause,
2227+
}),
2228+
}),
2229+
);
22222230
},
22232231
(effect, item) =>
22242232
effect.pipe(

0 commit comments

Comments
 (0)