fix: handle empty response body from background commands in runCommand#123
Open
johnlindquist wants to merge 1 commit intonamed-sandboxesfrom
Open
fix: handle empty response body from background commands in runCommand#123johnlindquist wants to merge 1 commit intonamed-sandboxesfrom
johnlindquist wants to merge 1 commit intonamed-sandboxesfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
johnlindquist
added a commit
to vercel-labs/vercel-openclaw
that referenced
this pull request
Apr 1, 2026
…fined Revert the beta SDK + detached bootstrap changes (357593f) to restore production stability. The beta SDK works correctly for basic ops but the startup script's pkill replacement (ps|grep|kill pattern) fails under set -euo pipefail in the beta sandbox's v2 session API. Progress saved in sandbox-beta-migration-wip.patch and the SDK fix PR at vercel/sandbox#123 is still open. Key findings from this session: - Beta SDK (2.0.0-beta.9) basic ops work (create, runCommand, detached, domain) - pkill returns exit 255 in v2 API (kills parent script) - runCommand with & background processes crashes with Zod validation error - detached:true mode works perfectly as replacement - openclaw@latest config schema is compatible with our buildGatewayConfig() - openclaw gateway --port 3000 (old syntax) still works
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
runCommandexecutes a bash command containing&(background process), the v2 API endpoint/v2/sandboxes/sessions/{id}/cmdreturns 200 with an empty body. The non-detached code path passes this toparseOrThrow(CommandResponse, ...), which fails because thecommandfield is required:This affects any command that backgrounds a process:
sb.runCommand("bash", ["-c", "node server.js &"])sb.runCommand("bash", ["/path/to/script-with-ampersand.sh"])detached: trueis unaffected (uses the NDJSON streaming path).Fix
Before calling
parseOrThrow, check if the response body is empty. If it is (and status is OK), return a syntheticCommandResponsepopulated from the request params instead of trying to parse undefined.Test plan