From 975dc3c3079f0f2565c955fc0e3474d6adbaf763 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sat, 14 Nov 2026 00:45:34 +0000 Subject: [PATCH] fix(web): rewind no longer offers file restore in project-folder threads The server rejects file restore for any thread without an isolated worktree, but the "Edit from here?" dialog enabled "Revert files too" whenever the checkpoint was ready. Disable it when the thread has no worktree, leaving conversation-only rewind. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/components/ChatView.tsx | 1 + apps/web/src/components/chat/ChatOverlayHosts.tsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index b161342f231d..9242d934169f 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -4037,6 +4037,7 @@ export default function ChatView(props: ChatViewProps) { {embedded ? null : } diff --git a/apps/web/src/components/chat/ChatOverlayHosts.tsx b/apps/web/src/components/chat/ChatOverlayHosts.tsx index 6f96399f9731..55e58ca7e24b 100644 --- a/apps/web/src/components/chat/ChatOverlayHosts.tsx +++ b/apps/web/src/components/chat/ChatOverlayHosts.tsx @@ -196,11 +196,14 @@ export function openRevertConfirm(threadKey: string, pending: PendingRevert): vo export function RevertConfirmHost(props: { readonly threadKey: string; readonly checkpoints: OrchestrationV2ThreadProjection["checkpoints"] | undefined; + readonly worktreePath: string | null; readonly onConfirm: (turnCount: number, messageId: MessageId, restoreFiles: boolean) => void; }) { const pending = useThreadOverlay(revertConfirmAtom, props.threadKey); + // The server refuses file restore outside an isolated worktree. const canRestoreFiles = pending !== null && + props.worktreePath !== null && findRevertCheckpoint(props.checkpoints ?? [], pending.turnCount)?.status === "ready"; const confirm = (restoreFiles: boolean) => { if (pending === null || (restoreFiles && !canRestoreFiles)) return;