From 692dd150143b50212b2e88af6d1467d37d3766c8 Mon Sep 17 00:00:00 2001 From: Zey413 <1115117931@qq.com> Date: Tue, 31 Mar 2026 17:36:11 +0800 Subject: [PATCH] fix(sandbox): add { once: true } to Docker abort signal listener Align the Docker sandbox abort listener with the rest of the codebase (15+ other abort listeners all use { once: true }). Without this, the listener can accumulate in long-running sessions with many tool calls, causing memory pressure. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/agents/sandbox/docker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agents/sandbox/docker.ts b/src/agents/sandbox/docker.ts index 6f90bbea94e..4a72efb0ea2 100644 --- a/src/agents/sandbox/docker.ts +++ b/src/agents/sandbox/docker.ts @@ -91,7 +91,7 @@ export function execDockerRaw( if (signal.aborted) { handleAbort(); } else { - signal.addEventListener("abort", handleAbort); + signal.addEventListener("abort", handleAbort, { once: true }); } }