fix(server): recover from provider interrupt failures #7412
Mergedmrmg(GitHub profile, opens in a new tab)merged 4 commits into
main fromrefs/pull/7412/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/server/src/orchestration/Layers/ProviderCommandReactor.ts line 1253Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1194,0 +1207,21 @@1207+ return Effect.logWarning(1208+ "provider command reactor failed to stop session after interrupt failure",1209+ {1210+ threadId: event.payload.threadId,1211+ cause: Cause.pretty(stopCause),1212+ originalCause: Cause.pretty(cause),1213+ },1214+ );1215+ }),1216+ );1217+ yield* setThreadSession({1218+ threadId: event.payload.threadId,1219+ session: {1220+ ...session,1221+ status: "stopped",1222+ activeTurnId: null,1223+ lastError: detail,1224+ updatedAt: event.payload.createdAt,1225+ },1226+ createdAt: event.payload.createdAt,1227+ });
- apps/server/src/orchestration/Layers/ProviderCommandReactor.ts line 1213Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1192,3 +1192,21 @@11921192 });11931193 }119411941195+ const recoverInterruptFailure = (cause: Cause.Cause<unknown>) => {1196+ if (Cause.hasInterruptsOnly(cause)) {1197+ return Effect.interrupt;1198+ }1199+1200+ const detail = formatFailureDetail(cause);1201+ return Effect.gen(function* () {1202+ const latestThread = yield* resolveThread(event.payload.threadId);1203+ const latestSession = latestThread?.session;1204+ if (1205+ !latestSession ||1206+ latestSession.status === "stopped" ||1207+ latestSession.activeTurnId === null ||1208+ (event.payload.turnId !== undefined &&1209+ latestSession.activeTurnId !== event.payload.turnId)1210+ ) {1211+ return;1212+ }
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
1602f7d4-1c71-4339-a3ef-47a82e360d5fYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share