authorgravatar for jerome@moinax.comJérôme Poskin <jerome@moinax.com> 2026-10-12 04:02:22+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-12 02:02:22+00:00
logf79f37a637bda257faa06a04184e368f78650d3d
treefdfbf852d45998e16397a1ad6e852c04dc9ce4de
parentdf78114360b77fc746f5dd5b91d006ca37c51f99
signature Signed by PGP key B5690EEEBB952194

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.

1 files changed, 7 insertions(+), 0 deletions(-)

packages/provider-acp/src/server/AcpSessionRuntime.ts+7
...@@ -285,6 +285,13 @@ export function wrapCommandForLinuxCgroup(...@@ -285,6 +285,13 @@ export function wrapCommandForLinuxCgroup(
285 '[ "$actual" = "$expected" ] || exit 126',285 '[ "$actual" = "$expected" ] || exit 126',
286 "unset ELECTRON_RUN_AS_NODE T3_ACP_CGROUP_WRAPPER",286 "unset ELECTRON_RUN_AS_NODE T3_ACP_CGROUP_WRAPPER",
287 "trap 'exit 125' 0",287 "trap 'exit 125' 0",
288 // The trap alone does not cover a failed `exec`: bash — which is
289 // /bin/sh on Arch derivatives — exits 127 without running the EXIT
290 // trap, so a missing agent binary reported "killed by the wrapper"
291 // instead of "never launched". The caller always hands us an absolute
292 // target, so test it as an executable file rather than asking the
293 // shell to resolve it.
294 '[ -f "$1" ] && [ -x "$1" ] || exit 125',
288 'exec "$@"',295 'exec "$@"',
289 ].join("\n"),296 ].join("\n"),
290 "t3-acp-cgroup-wrapper",297 "t3-acp-cgroup-wrapper",