fix(cursor): stop acknowledging soft steers that an abort cancels (#2229)

Abort sends session/cancel, and ACP answers the pending soft-steer
session/prompt with stopReason "cancelled". The completion handler
ignored the stopReason and acknowledged the row as steered, so a
message Cursor may never have run was shown as delivered.

Surface the stopReason from beginSoftSteerPrompt. On "cancelled" the
row is held as indeterminate (the same path a transport failure takes),
because Cursor may or may not have folded it into the cancelled turn:
the user resolves it with Retry or Cancel instead of a silent claim or
an automatic re-run after Stop.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SSU-WEI HUANG
2026-10-29 08:07:28 +08:00
committed by GitHub
co-authored by Claude Opus 5.5
parent ba7494c5b5
commit b4be7c2d93
3 changed files with 47 additions and 5 deletions
+11 -2
View File
@@ -509,7 +509,7 @@ class CursorAcpRemoteLauncher extends RemoteLauncherBase {
await restoreQueuedReservation();
return { steered: false, error: 'Active turn changed' };
}
let steer: { dispatched: Promise<void>; completed: Promise<void> };
let steer: { dispatched: Promise<void>; completed: Promise<string | null> };
try {
steer = backend.beginSoftSteerPrompt(acpSessionId, [{
type: 'text',
@@ -557,7 +557,16 @@ class CursorAcpRemoteLauncher extends RemoteLauncherBase {
// JSON-RPC rejection means ACP never accepted the instruction
// (restore it for the next prompt), while a transport failure
// (abort/disconnect) keeps the row reserved — never re-delivered.
void steer.completed.then(() => {
void steer.completed.then((stopReason) => {
// Abort answers an unfinished soft steer with `cancelled`.
// Cursor may or may not have folded it into the turn, so
// hold it for explicit Retry/Cancel instead of claiming it.
if (stopReason === 'cancelled') {
if (session.queue.markReservationIndeterminate(taken)) {
session.client.emitSteerIndeterminate([localId]);
}
return;
}
// Completion means ACP accepted the inject: the ACK must
// reach the hub even when an abort reset the queue and
// cancelled the reservation in between.