From 743fa89b7ef5a32379580c61b6dc5bcaf3bb9f3f Mon Sep 17 00:00:00 2001 From: Landon Cox Date: Thu, 4 Jun 2026 16:49:51 -0700 Subject: [PATCH 1/3] fix(test): use unlinkSync for symlink cleanup in tool-cache mount test fs.rmSync without recursive:true fails on macOS when the path is a symlink to a directory. Use unlinkSync instead which correctly removes the symlink itself. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/services/agent-volumes-mounts.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/agent-volumes-mounts.test.ts b/src/services/agent-volumes-mounts.test.ts index 4ba4befc9..4ef489fb9 100644 --- a/src/services/agent-volumes-mounts.test.ts +++ b/src/services/agent-volumes-mounts.test.ts @@ -557,7 +557,7 @@ describe('agent service', () => { expect(volumes).not.toContain(`${symlinkPath}:/host${symlinkPath}:ro`); }); } finally { - fs.rmSync(symlinkPath, { force: true }); + try { fs.unlinkSync(symlinkPath); } catch { /* already removed */ } fs.rmSync(symlinkTarget, { recursive: true, force: true }); } }); From b8f59cbe38aad9a1417adf69b700fa977684cdff Mon Sep 17 00:00:00 2001 From: Landon Cox Date: Thu, 4 Jun 2026 17:18:40 -0700 Subject: [PATCH 2/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/services/agent-volumes-mounts.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/services/agent-volumes-mounts.test.ts b/src/services/agent-volumes-mounts.test.ts index 4ef489fb9..506825503 100644 --- a/src/services/agent-volumes-mounts.test.ts +++ b/src/services/agent-volumes-mounts.test.ts @@ -557,7 +557,11 @@ describe('agent service', () => { expect(volumes).not.toContain(`${symlinkPath}:/host${symlinkPath}:ro`); }); } finally { - try { fs.unlinkSync(symlinkPath); } catch { /* already removed */ } + try { + fs.unlinkSync(symlinkPath); + } catch (err) { + if ((err as NodeJS.ErrnoException).code !== 'ENOENT') throw err; + } fs.rmSync(symlinkTarget, { recursive: true, force: true }); } }); From 943b48cefa05ea1c578d65afd592898ecb4c642f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Jun 2026 00:35:31 +0000 Subject: [PATCH 3/3] fix(test): avoid no-unsafe-finally in symlink cleanup --- src/services/agent-volumes-mounts.test.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/services/agent-volumes-mounts.test.ts b/src/services/agent-volumes-mounts.test.ts index 506825503..09b21737b 100644 --- a/src/services/agent-volumes-mounts.test.ts +++ b/src/services/agent-volumes-mounts.test.ts @@ -557,10 +557,8 @@ describe('agent service', () => { expect(volumes).not.toContain(`${symlinkPath}:/host${symlinkPath}:ro`); }); } finally { - try { + if (fs.existsSync(symlinkPath)) { fs.unlinkSync(symlinkPath); - } catch (err) { - if ((err as NodeJS.ErrnoException).code !== 'ENOENT') throw err; } fs.rmSync(symlinkTarget, { recursive: true, force: true }); }