Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix: Cursor steering no longer waits for the turn to finish #14586

Closedmxdhavgautam(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/14586/headopened View on GitHub

Showing 10 changed files with 76 additions and 0 deletions (loading 9).

x
0 of 10 viewed, 10 left
76 additions and 0 deletionsapps/server/src/provider/Layers/CursorAdapter.test.tsModified
View file
@@ -443,6 +443,82 @@
}),
​
+ it.effect("sends a steer without waiting for the running prompt to finish", () =>
+ Effect.gen(function* () {
+ const adapter = yield* CursorAdapter;
+ const settings = yield* ServerSettingsService;
+ const threadId = ThreadId.make("cursor-steer-immediate");
+ const tempDir = yield* Effect.promise(() =>
+ NodeFSP.mkdtemp(NodePath.join(NodeOS.tmpdir(), "cursor-acp-")),
+ );
+ const requestLogPath = NodePath.join(tempDir, "requests.ndjson");
+ const argvLogPath = NodePath.join(tempDir, "argv.txt");
+ yield* Effect.promise(() => NodeFSP.writeFile(requestLogPath, "", "utf8"));
+ // The first prompt never finishes on its own, so the steer only reaches
+ // the agent if it cancels the running prompt instead of queueing.
+ const wrapperPath = yield* Effect.promise(() =>
+ makeProbeWrapper(requestLogPath, argvLogPath, { T3_ACP_HANG_FIRST_PROMPT_FOREVER: "1" }),
+ );
+ yield* settings.updateSettings({ providers: { cursor: { binaryPath: wrapperPath } } });
+​
+ const runtimeEventsFiber = yield* adapter.streamEvents.pipe(
+ Stream.filter((event) => event.threadId === threadId),
+ // Collect through session exit so a duplicate turn.completed is caught.
+ Stream.takeUntil((event) => event.type === "session.exited"),
+ Stream.runCollect,
+ Effect.forkChild,
+ );
+​