Skip to content

Commit 29e815f

Browse files
t3dotggclaude
andcommitted
fix(web): don't toast delete failure when only worktree cleanup failed
Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent f0ffb14 commit 29e815f

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎apps/web/src/hooks/useThreadActionMenu.ts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,17 @@ export function useThreadActionMenu(input: {
254254
);
255255
if (confirmed._tag === "Failure" || !confirmed.value) return;
256256
}
257-
await reportFailure("Failed to delete thread", () => deleteThread(threadRef));
257+
const deleted = await deleteThread(threadRef);
258+
if (
259+
deleted._tag === "Failure" &&
260+
!isAtomCommandInterrupted(deleted) &&
261+
// A failure with the thread already gone is worktree cleanup
262+
// failing after a successful delete — deleteThread has toasted
263+
// that itself, and "Failed to delete thread" would be a lie.
264+
readThreadShell(threadRef) !== null
265+
) {
266+
failureToast("Failed to delete thread", squashAtomCommandFailure(deleted));
267+
}
258268
return;
259269
}
260270
default:

0 commit comments

Comments
 (0)