#137

Sandbox error handling

Openjasonkneenwants to merge intofrom
  • Add pre-flight validation of Vercel API credentials and timeout values
  • Extract and log detailed error messages from Vercel API responses
  • Add team/project ID logging (masked for security)
  • Better error handling for 500 errors with Vercel status page reference
  • More descriptive error messages for invalid timeout values
  • Cap MAX_SANDBOX_DURATION to 40 minutes (Vercel API max is 45 minutes)
  • Add Math.min() cap in creation.ts to prevent timeout > 2700000ms
  • Add 60-second timeout for Sandbox.create() API call to prevent indefinite hanging
  • Add diagnostic logging for sandbox configuration and creation initiation
  • Improve error messaging for API credential issues

Activity

7
vercel[bot]1y ago

@jasonkneen is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

copilot-pull-request-reviewer[bot]reviewed1y ago
copilot-pull-request-reviewer[bot]1y ago

Pull Request Overview

This PR improves error handling and validation for Vercel sandbox creation by adding pre-flight checks, better error messages, and timeout management to prevent API failures and indefinite hangs.

Key changes:

  • Adds pre-flight validation for Vercel API credentials (team ID, project ID, token) with descriptive error messages
  • Implements a 60-second timeout for sandbox creation to prevent indefinite hanging
  • Extracts and logs detailed error information from Vercel API responses, including special handling for 500 errors
  • Caps sandbox timeout at 40 minutes (with Math.min enforcement) to stay within Vercel's 45-minute API limit

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

FileDescription
lib/sandbox/creation.tsAdds credential validation, 60s creation timeout, detailed error logging, and timeout capping logic
lib/constants.tsUpdates MAX_SANDBOX_DURATION default from 300 to 40 minutes with safety cap
.claude/settings.local.jsonAdds local development permissions configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

ctatereviewed1y ago
ctatereviewed1y ago
ctate1y ago

@jasonkneen Thank you so much! Left a couple of small comments. Everything else looks great 🙏