Add stdout to command execution results#32
Conversation
Include the buffered stdout from executed commands in the CommandResult / CommandExecutionResultItem so callers can access the full output alongside exitCode, not just the real-time stream. Bump both packages to 0.12.0. Made-with: Cursor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ccdcc96. Configure here.
| signal: this.abortController.signal, | ||
| }, | ||
| (error, stdout, stderr) => { | ||
| capturedStdout = stdout; |
There was a problem hiding this comment.
Error path resolves without stdout, losing captured output
Medium Severity
When a command fails (non-zero exit code), exec's callback fires with an error and the Promise resolves at line 61 with { exitCode: code, error } — omitting stdout. Since Node.js execFile internally registers its close handler before the external one, the error resolve fires first, and the subsequent close handler's resolve (which does include stdout) becomes a no-op. This means any command that produces output before failing (e.g. a build tool that prints logs then exits non-zero) will have its stdout silently discarded from CommandResult, despite capturedStdout being correctly set on the line above.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit ccdcc96. Configure here.


Summary
CommandHandler.execute()and include it inCommandResultso the full command output is available in the final result, not just via the real-time streaming callbacks.stdoutfield through the wire protocol (CommandExecutionResultItem) and the Python client (CommandResultItem).runtimeuseandruntimeuse-clientto 0.12.0.Test plan
npm test— 143 tests)pytest test/test_client.py— 44 tests)pytest test -m e2e— 36 tests)E2B_API_KEY)Made with Cursor
Note
Medium Risk
Changes the command execution wire protocol and result types to include buffered
stdout, which may affect clients expecting the old schema and increases returned payload size. Logic is straightforward but touches runtime execution and cross-language compatibility (TS server + Python client).Overview
Command-only execution results now include buffered stdout.
CommandHandler.execute()captures the finalstdout(with secret redaction) and returns it alongsideexitCode, andInvocationRunner.runCommandsOnlythreads this through thecommand_execution_result_messagepayload.The wire type
CommandExecutionResultItemand the Python client modelCommandResultItemadd an optionalstdoutfield, with tests updated/added to assertstdoutpresence on success and absence on failures. Package versions are bumped to0.12.0in bothruntimeuseandruntimeuse-client.Reviewed by Cursor Bugbot for commit ccdcc96. Bugbot is set up for automated code reviews on this repo. Configure here.