Skip to content

Commit 975dc3c

Browse files
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 <[email protected]>
1 parent 2a1caac commit 975dc3c

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4037,6 +4037,7 @@ export default function ChatView(props: ChatViewProps) {
40374037
<RevertConfirmHost
40384038
threadKey={routeThreadKey}
40394039
checkpoints={serverProjection?.checkpoints}
4040+
worktreePath={activeThread?.worktreePath ?? null}
40404041
onConfirm={onConfirmRevertStable}
40414042
/>
40424043
{embedded ? null : <LinkPullRequestDialogHost />}

‎apps/web/src/components/chat/ChatOverlayHosts.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,14 @@ export function openRevertConfirm(threadKey: string, pending: PendingRevert): vo
196196
export function RevertConfirmHost(props: {
197197
readonly threadKey: string;
198198
readonly checkpoints: OrchestrationV2ThreadProjection["checkpoints"] | undefined;
199+
readonly worktreePath: string | null;
199200
readonly onConfirm: (turnCount: number, messageId: MessageId, restoreFiles: boolean) => void;
200201
}) {
201202
const pending = useThreadOverlay(revertConfirmAtom, props.threadKey);
203+
// The server refuses file restore outside an isolated worktree.
202204
const canRestoreFiles =
203205
pending !== null &&
206+
props.worktreePath !== null &&
204207
findRevertCheckpoint(props.checkpoints ?? [], pending.turnCount)?.status === "ready";
205208
const confirm = (restoreFiles: boolean) => {
206209
if (pending === null || (restoreFiles && !canRestoreFiles)) return;

0 commit comments

Comments
 (0)