From f79f37a637bda257faa06a04184e368f78650d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Poskin?= Date: Mon, 12 Oct 2026 04:02:22 +0200 Subject: [PATCH] fix(server): missing agent binaries report launch failure Return exit 125 when the Linux cgroup wrapper target is missing, including when /bin/sh is Bash. Preserve arguments and child exit codes. --- packages/provider-acp/src/server/AcpSessionRuntime.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/provider-acp/src/server/AcpSessionRuntime.ts b/packages/provider-acp/src/server/AcpSessionRuntime.ts index 683bf8c90f41e3690ea9e0ef639a2f894b5c880b..e40b0c555e5411f19854fb873b8cb1806c753e74 100644 --- a/packages/provider-acp/src/server/AcpSessionRuntime.ts +++ b/packages/provider-acp/src/server/AcpSessionRuntime.ts @@ -285,6 +285,13 @@ export function wrapCommandForLinuxCgroup( '[ "$actual" = "$expected" ] || exit 126', "unset ELECTRON_RUN_AS_NODE T3_ACP_CGROUP_WRAPPER", "trap 'exit 125' 0", + // The trap alone does not cover a failed `exec`: bash — which is + // /bin/sh on Arch derivatives — exits 127 without running the EXIT + // trap, so a missing agent binary reported "killed by the wrapper" + // instead of "never launched". The caller always hands us an absolute + // target, so test it as an executable file rather than asking the + // shell to resolve it. + '[ -f "$1" ] && [ -x "$1" ] || exit 125', 'exec "$@"', ].join("\n"), "t3-acp-cgroup-wrapper", -- 2.54.0