Skip to content

Commit f79f37a

Browse files
authored
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 parent df78114 commit f79f37a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎packages/provider-acp/src/server/AcpSessionRuntime.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,13 @@ export function wrapCommandForLinuxCgroup(
285285
'[ "$actual" = "$expected" ] || exit 126',
286286
"unset ELECTRON_RUN_AS_NODE T3_ACP_CGROUP_WRAPPER",
287287
"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',
288295
'exec "$@"',
289296
].join("\n"),
290297
"t3-acp-cgroup-wrapper",

0 commit comments

Comments
 (0)