fix(cursor): Stop no longer runs a queued steer #13423
ClosedValeraZSD(GitHub profile, opens in a new tab)wants to merge 2 commits into
main fromrefs/pull/13423/headopened 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:S
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
- apps/server/src/provider/Layers/CursorAdapter.test.ts lines 483 to 490OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -445,0 +470,21 @@470+471+ yield* adapter.startSession({472+ threadId,473+ provider: ProviderDriverKind.make("cursor"),474+ cwd: process.cwd(),475+ runtimeMode: "full-access",476+ modelSelection: { instanceId: ProviderInstanceId.make("cursor"), model: "default" },477+ });478+479+ const firstTurnFiber = yield* adapter480+ .sendTurn({ threadId, input: "run 5 commands", attachments: [] })481+ .pipe(Effect.forkChild);482+ yield* Effect.gen(function* () {483+ for (let attempt = 0; attempt < 200; attempt += 1) {484+ const sessions = yield* adapter.listSessions();485+ if (sessions.find((entry) => entry.threadId === threadId)?.activeTurnId !== undefined) {486+ return;487+ }488+ yield* TestClock.adjust("10 millis");489+ }490+ throw new Error("Timed out waiting for the first prompt to be in flight.");apps/server/src/provider/Layers/CursorAdapter.ts lines 983 to 986OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -976,3 +980,7 @@976980 // resolving from here on does not settle the turn; the matching977981 // decrement is the `ensuring` below.978982 ctx.promptsInFlight += 1;983+ if (steeringTurnId === undefined) {984+ ctx.turnInterrupted = yield* Deferred.make<void>();985+ }986+ const turnInterrupted = ctx.turnInterrupted;
juliusmarminge closed this
Sign in to join this conversation.
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
15f96add-a6c2-4f95-802e-87d04b33f3b7📥 Commits
Reviewing files that changed from the base of the PR and between fd5e9f2d50a46923c3c0dcb4e4883cfda8a4a37e and 4a7153090afc59b918fe15089175f1d500be8ccf.
📒 Files selected for processing (2)
apps/server/src/provider/Layers/CursorAdapter.test.tsapps/server/src/provider/Layers/CursorAdapter.ts🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.
📝 Walkthrough
Walkthrough#
CursorAdapter tracks interruption for each turn and races the ACP prompt against that signal. If interruption occurs while a prompt waits behind a running prompt, the queued prompt returns as cancelled without reaching the agent.
Changes#
Cursor turn interruption
apps/server/src/provider/Layers/CursorAdapter.ts,apps/server/src/provider/Layers/CursorAdapter.test.tssendTurnraces the ACP prompt against the signal, andinterruptTurnresolves it. The test verifies that an interrupted queued steer completes as cancelled and does not reach the agent.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
4a715The queued-steer fix has no established new merge-blocking risk; normal checks remain appropriate before merging.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.