From 8db7b685837e015dc922825f03641a221e5becf7 Mon Sep 17 00:00:00 2001 From: Josh Lambert Date: Sun, 14 Jun 2026 21:48:49 -0400 Subject: [PATCH] fix(cli): restore moved files during snapshot revert --- .changeset/revert-file-moves.md | 5 +++++ packages/opencode/src/snapshot/index.ts | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/revert-file-moves.md diff --git a/.changeset/revert-file-moves.md b/.changeset/revert-file-moves.md new file mode 100644 index 00000000000..52e0a08868e --- /dev/null +++ b/.changeset/revert-file-moves.md @@ -0,0 +1,5 @@ +--- +"@kilocode/cli": patch +--- + +Restore files to their original paths when reverting a task that moved or renamed them. diff --git a/packages/opencode/src/snapshot/index.ts b/packages/opencode/src/snapshot/index.ts index 2189036abcd..372b5d93da6 100644 --- a/packages/opencode/src/snapshot/index.ts +++ b/packages/opencode/src/snapshot/index.ts @@ -420,7 +420,12 @@ export const layer: Layer.Layer = Effect.gen(function* () { yield* add() const result = yield* git( - [...quote, ...args(["diff", "--cached", "--no-ext-diff", "--name-only", hash, "--", "."])], + // kilocode_change start + [ + ...quote, + ...args(["diff", "--cached", "--no-ext-diff", "--no-renames", "--name-only", hash, "--", "."]), + ], + // kilocode_change end { cwd: state.directory, },