File tree Expand file tree Collapse file tree
apps/sim/executor/handlers/pi/cloud Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ describe('buildPiScript', () => {
119119
120120 it ( 'filters Pi output inside the sandbox without masking pipeline failures' , ( ) => {
121121 const script = buildPiScript ( )
122- expect ( script ) . toContain ( 'set -o pipefail' )
122+ expect ( script ) . toMatch ( / ^ \/ b i n \/ b a s h - o p i p e f a i l - c ' / )
123123 expect ( script ) . toContain ( `| node ${ PI_EVENT_FILTER_PATH } ` )
124124 expect ( PI_EVENT_FILTER_PATH . startsWith ( '/workspace/repo' ) ) . toBe ( false )
125125 } )
Original file line number Diff line number Diff line change @@ -249,6 +249,10 @@ process.stdin.on('end', () => processLine(buffer))
249249 * The Pi CLI invocation for the sandbox modes. Every caller receives the compact event stream;
250250 * options only control which repository resources Pi may load.
251251 *
252+ * Selects `/bin/bash` explicitly because `pipefail` is not portable to `/bin/sh`. Both dedicated
253+ * Pi images are Debian-based and provide Bash, so provider default-shell behavior cannot change
254+ * whether an upstream Pi failure reaches the caller.
255+ *
252256 * With one, `--no-extensions` drops any extension the cloned repository ships while leaving the
253257 * explicit `-e` path loaded, so the loaded set is exactly Sim's own extension. That is deliberate —
254258 * a repository must not be able to register tools into a run holding the workspace's keys — but it
@@ -267,9 +271,8 @@ export function buildPiScript(
267271 ? ' --no-extensions'
268272 : ''
269273 const extensionArgs = extensionPath ? ` -e ${ extensionPath } ` : ''
270- return `set -o pipefail
271- cd ${ REPO_DIR }
272- pi -p --mode json --provider "$PI_PROVIDER" --model "$PI_MODEL" --thinking "$PI_THINKING"${ repositoryArgs } ${ extensionArgs } < ${ PROMPT_PATH } | node ${ PI_EVENT_FILTER_PATH } `
274+ return `/bin/bash -o pipefail -c 'cd ${ REPO_DIR }
275+ pi -p --mode json --provider "$PI_PROVIDER" --model "$PI_MODEL" --thinking "$PI_THINKING"${ repositoryArgs } ${ extensionArgs } < ${ PROMPT_PATH } | node ${ PI_EVENT_FILTER_PATH } '`
273276}
274277
275278export function raceAbort < T > ( promise : Promise < T > , signal ?: AbortSignal ) : Promise < T > {
You can’t perform that action at this time.
0 commit comments