-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
@agentuity/serverServer packageServer package
Description
Summary
The sandboxRun() function in @agentuity/server hardcodes exit codes instead of retrieving the actual values from the execution.
Location
packages/server/src/api/sandbox/run.ts (compiled to dist/api/sandbox/run.js)
Current Behavior
if (finalStatus === 'terminated') {
return { sandboxId, exitCode: 0, ... }; // Hardcoded
}
if (finalStatus === 'failed') {
return { sandboxId, exitCode: 1, ... }; // Hardcoded
}The function polls sandboxGet() for status but never calls executionGet() to retrieve the actual exit code from the execution info.
Expected Behavior
run() should return the actual exit code from the process, similar to how SandboxInstance.execute() does it by calling executionGet() and returning finalResult.exitCode.
Workaround
Use client.create() + sandbox.execute() instead of client.run() to get real exit codes:
const sandbox = await client.create(options);
const execution = await sandbox.execute({ command: ['bun', 'run', 'script.ts'] });
console.log(execution.exitCode); // Real exit code
await sandbox.destroy();Impact
Scripts that exit with non-zero codes (e.g., process.exit(2)) will incorrectly report exitCode: 0 when using client.run().
Metadata
Metadata
Assignees
Labels
@agentuity/serverServer packageServer package
Type
Projects
Status
No status