fix(server): mark Cursor transport error answers as failed #10337
Mergedshivamhwp(GitHub profile, opens in a new tab)merged 4 commits into
main fromrefs/pull/10337/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/server/src/provider/acp/CursorTransportFailure.ts line 14Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +12,21 @@12+ const fence = /^ {0,3}(`{3,}|~{3,})(.*)$/.exec(line);13+ const marker = fence?.[1];14+ if (state.fence) {15+ if (16+ marker &&17+ marker[0] === state.fence[0] &&18+ marker.length >= state.fence.length &&19+ fence?.[2]?.trim() === ""20+ ) {21+ state.fence = undefined;22+ }23+ state.failure = undefined;24+ return;25+ }26+ if (marker) {27+ state.fence = marker;28+ state.failure = undefined;29+ return;30+ }31+ const text = line.trimEnd();32+ if (transportError.test(text) || text === serverError) {
- apps/server/src/provider/Layers/CursorAdapter.ts line 1076OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1061,3 +1067,10 @@10611067 ),10621068 );106310691070+ yield* ctx.acp.drainEvents;1071+ const failure = ctx.assistantReply.failure;1072+ if (ctx.promptsInFlight === 1 && result.stopReason !== "cancelled" && failure) {1073+ return yield* new ProviderAdapterRequestError({1074+ provider: PROVIDER,1075+ method: "session/prompt",1076+ detail: `Cursor reported a transport failure: ${failure}`,
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
shivamhwp(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed