From 79dfc1d9ad271d7bb29550c375aca0997f472a2d Mon Sep 17 00:00:00 2001 From: "Michal J. Gajda" Date: Fri, 17 Jul 2026 15:55:13 +0200 Subject: [PATCH] fix(snapshot): handle info/exclude write failure gracefully instead of orDie MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Snapshot.sync writes info/exclude with Effect.orDie, so any EACCES (from UID mismatch in containerized setups or concurrent session writes) crashes SessionProcessor mid-conversation. The exclude file is advisory — a write failure should log a warning and continue. Closes #37493 --- packages/opencode/src/snapshot/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/snapshot/index.ts b/packages/opencode/src/snapshot/index.ts index 4da9bc3ca864..881a3eaa5e16 100644 --- a/packages/opencode/src/snapshot/index.ts +++ b/packages/opencode/src/snapshot/index.ts @@ -188,8 +188,12 @@ const layer: Layer.Layer + Effect.logWarning("failed to ensure snapshot info dir", err) + )) + yield* fs.writeFileString(target, text ? `${text}\n` : "").pipe(Effect.catch((err) => + Effect.logWarning("failed to write snapshot excludes", err) + )) }) // Reuse the hashes for the git storage between the original repo and snapshot