Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(provider-acp): name the rejected agent path on stderr and test the bash path #18489

Mergedonly21mil(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/18489/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 12 additions and 2 deletions.

x
0 of 2 viewed, 2 left
9 additions and 0 deletionsapps/server/src/provider/acp/AcpSessionRuntime.processTree.test.tsModified
View file
@@ -308,6 +308,15 @@
expect(missingTargetResult.status, missingTargetResult.stderr).toBe(125);
+ // CI's /bin/sh is dash, which runs the EXIT trap after a failed exec. Bash does not,
+ // so run the same wrapper under bash too.
+ const missingTargetBash = NodeChildProcess.spawnSync("bash", missingTarget.args, {
+ encoding: "utf8",
+ });
+ if ((missingTargetBash.error as NodeJS.ErrnoException | undefined)?.code !== "ENOENT") {
+ expect(missingTargetBash.status, missingTargetBash.stderr).toBe(125);
+ expect(missingTargetBash.stderr).toContain("/nonexistent-t3-probe");
+ }
} finally {
packagedExecPath.mockRestore();
NodeFS.rmSync(scratch, { recursive: true, force: true });
3 additions and 2 deletionspackages/provider-acp/src/server/AcpSessionRuntime.tsModified
View file
@@ -290,8 +290,9 @@
// 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',
+ // shell to resolve it. Name the target before exiting: exit 125 alone
+ // does not say which path was rejected.
+ '[ -f "$1" ] && [ -x "$1" ] || { printf "%s: %s: not an executable file\\n" "$0" "$1" >&2; exit 125; }',
'exec "$@"',