Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): mark Cursor transport error answers as failed #10337

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/10337/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Showing 4 changed files with 111 additions and 0 deletions (loading 1).

x
0 of 4 viewed, 4 left
36 additions and 0 deletionsapps/server/src/provider/Layers/CursorAdapter.test.tsModified
View file
@@ -162,6 +162,42 @@
​
cursorAdapterTestLayer("CursorAdapterLive", (it) => {
+ it.effect("rejects a Cursor transport error returned as a successful assistant answer", () =>
+ Effect.gen(function* () {
+ const adapter = yield* CursorAdapter;
+ const settings = yield* ServerSettingsService;
+ const threadId = ThreadId.make("cursor-transport-error-answer");
+ const wrapperPath = yield* Effect.promise(() =>
+ makeMockAgentWrapper({
+ T3_ACP_PROMPT_RESPONSE_TEXT: "Error: RetriableError: WritableIterable is closed",
+ }),
+ );
+ yield* settings.updateSettings({ providers: { cursor: { binaryPath: wrapperPath } } });
+ const runtimeEventsFiber = yield* adapter.streamEvents.pipe(
+ Stream.takeUntil((event) => event.type === "session.exited"),
+ Stream.runCollect,
+ Effect.forkChild,
+ );
+ yield* adapter.startSession({
+ threadId,
+ provider: ProviderDriverKind.make("cursor"),
+ cwd: process.cwd(),
+ runtimeMode: "full-access",
+ });
+ const error = yield* adapter
+ .sendTurn({ threadId, input: "continue", attachments: [] })
+ .pipe(Effect.flip);
+ assert.equal(error._tag, "ProviderAdapterRequestError");