Skip to content

fix(execution): name the signal that killed a sandbox process in its error - #9523

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/sandbox-exit-signal-error
Oct 31, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/sandbox-exit-signal-error

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • A failed shell command's error was its raw stderr, and the exit code appeared only when stderr was empty. A process killed by a signal (out of memory, a terminated run) that had printed a harmless warning first reported that warning as the error, so the agent chased the warning (e.g. "set an HF_TOKEN") instead of the kill
  • About a fifth of failed sandbox shell commands in a day of production logs were signal kills (mostly SIGTERM, then SIGKILL)
  • Shell errors now always lead with the exit code, naming the signal for a 128 + n code, followed by the process's own output: Process exited with code 137 (the exit code of SIGKILL, usually out of memory): <stderr>. The code alone cannot prove a kill (a program may exit 137 itself), so it is described as the signal's code, not asserted
  • Python/JavaScript failures keep the headline they printed as the error name and value; for a 128 + n exit code the same exit description is appended (<value> [Process exited with code 137 (…)]), so neither a program's own error nor the exit code is lost. Other exit codes are unchanged
  • Shared by Mothership run_code and workflow Function blocks; nothing parses the message

Type of Change

  • Bug fix

Testing

  • lib/execution/remote-sandbox/conformance.test.ts (E2B and Daytona): a command killed with 137 after printing a warning reports the signal first and keeps the warning; fails on staging for both providers. The existing "real command output" case still holds
  • lib/execution/remote-sandbox/code-failure.test.ts: a printed headline survives a 137 exit with the exit description appended, and exit code 1 is unchanged; exit-code descriptions at 1, 128, 129, 143 and 193
  • 219/219 in both files; bun run lint, check:utils, check:comment-hygiene, check:test-patterns, check:explicit-any, check:source-conventions
  • Type-check, full check:audits and the test suites run in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 31, 2026 10:01am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

The PR adds exit-code descriptions to sandbox errors while keeping the process’s printed output.

  • Failed sandbox runs show exit codes beside their printed output.

Reviews (2) · Last reviewed commit: "fix(execution): describe a signal's exit..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 22bf85a into staging Oct 31, 2026
70 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/sandbox-exit-signal-error branch October 31, 2026 17:45

This branch was previously deployed

1 inactive deployment
Preview — e020a2b7 Deployed Oct 31, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant