From 1b036b691562ce71be2e8970671188995ae09d12 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:37:58 +0000 Subject: [PATCH] fix: skip snapshotting ../imports outside config dir to prevent rollback overwriting unrelated files Co-Authored-By: mantra --- packages/local-config-updater/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/local-config-updater/src/index.ts b/packages/local-config-updater/src/index.ts index c702ab24e..3cc9842d5 100644 --- a/packages/local-config-updater/src/index.ts +++ b/packages/local-config-updater/src/index.ts @@ -201,7 +201,9 @@ function snapshotConfigFiles(configFilePath: string, configContent: string): Con const dir = path.dirname(configFilePath); const snapshots: ConfigFileSnapshot[] = [{ path: path.resolve(configFilePath), content: configContent }]; for (const specifier of getRelativeImportSpecifiers(configContent)) { - captureSnapshotIfAbsent(snapshots, path.resolve(dir, specifier)); + const resolved = path.resolve(dir, specifier); + if (!isPathInsideDir(dir, resolved)) continue; + captureSnapshotIfAbsent(snapshots, resolved); } return snapshots; }