Make Chat abort actually stop the agent turn.

Wire should_stop from aborted runs, snapshot abort before clearing flags so finals are not emitted after stop, and keep fail-path turn_uuid aligned for bubble splitting.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-07-23 10:16:07 +08:00
parent 23ecce4755
commit 3cdf550298
7 changed files with 450 additions and 62 deletions

View file

@ -5304,6 +5304,10 @@ ${autoLimit ? `<div style="margin-top:8px;"><span class="muted">auto-added claus
}
if (eventName === "session.turn_started") {
turnAcceptedAtMs = Number(payload.acceptedAt || Date.now()) || Date.now();
if (payload.runId) {
chatRunId = String(payload.runId);
currentAbortMeta = { sessionId: String(activeId || ""), runId: String(chatRunId || "") };
}
_setStreamStatusBase("start");
return;
}