diff options
| author | Olcan <[email protected]> | 2025-05-21 08:51:22 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-21 08:51:22 -0700 |
| commit | c9de822930dff0a4bbd3ee5e13023b54dc0222c3 (patch) | |
| tree | 9f1c4cfda388bc08cdd5dcea761e6f0ea8f50c98 | |
| parent | e30dc716b4fa7684e056987be87006cc5d6696a7 (diff) | |
fix exit code for shell tool (#465)
| -rw-r--r-- | packages/server/src/tools/shell.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/server/src/tools/shell.ts b/packages/server/src/tools/shell.ts index 73f54b44..e130fb04 100644 --- a/packages/server/src/tools/shell.ts +++ b/packages/server/src/tools/shell.ts @@ -141,7 +141,7 @@ export class ShellTool extends BaseTool<ShellToolParams, ToolResult> { let command = params.command.trim(); if (!command.endsWith('&')) command += ';'; // note the final echo is only to trigger the stderr handler below - command = `{ ${command} }; pgrep -g 0 >${tempFilePath} 2>&1; ( trap '' PIPE ; echo >&2 )`; + command = `{ ${command} }; __code=$?; pgrep -g 0 >${tempFilePath} 2>&1; ( trap '' PIPE ; echo >&2 ); exit $__code;`; // spawn command in specified directory (or project root if not specified) const shell = spawn('bash', ['-c', command], { |
