From f0924319cededac1157f86df5e246d024c72648a Mon Sep 17 00:00:00 2001 From: Kagura Date: Sun, 19 Apr 2026 19:26:46 +0800 Subject: [PATCH] fix(ripgrep): use non-scoped temp directory to prevent premature cleanup (#23411) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The extract helper wraps makeTempDirectoryScoped with Effect.scoped, causing the temp directory to be deleted when extract returns — before the caller can check the extracted binary or copy it to the target path. Switch to makeTempDirectory (non-scoped) and manually remove the temp directory after the copy succeeds or on error. --- packages/opencode/src/file/ripgrep.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/opencode/src/file/ripgrep.ts b/packages/opencode/src/file/ripgrep.ts index c84d9b522a3d..bccf12fd729f 100644 --- a/packages/opencode/src/file/ripgrep.ts +++ b/packages/opencode/src/file/ripgrep.ts @@ -248,7 +248,7 @@ export const layer: Layer.Layer which("powershell.exe") ?? which("pwsh.exe"))) ?? "powershell.exe" @@ -260,6 +260,7 @@ export const layer: Layer.Layer