fix(tui): abort in-progress generation on undo (#4744)

This commit is contained in:
Tommy D. Rossi 2025-11-25 23:35:34 +01:00 committed by GitHub
commit 64caeeb12d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -319,7 +319,9 @@ export function Session() {
value: "session.undo",
keybind: "messages_undo",
category: "Session",
onSelect: (dialog) => {
onSelect: async (dialog) => {
const status = sync.data.session_status[route.sessionID]
if (status?.type !== "idle") await sdk.client.session.abort({ path: { id: route.sessionID } }).catch(() => {})
const revert = session().revert?.messageID
const message = messages().findLast((x) => (!revert || x.id < revert) && x.role === "user")
if (!message) return