feat: add metadata_only param to GET /api/sandboxes
Merge conflicts
SW
8mo ago+353+353+012345678901234567890123456789-59-59-01234567890123456789
Summary
- Adds
metadata_only=truequery parameter toGET /api/sandboxesthat skips expensiveSandbox.get()API calls to Vercel - When
metadata_only=true, returns onlysnapshot_id,github_repo, andfiletree(emptysandboxesarray) - Prevents 100+ parallel Vercel API calls that cause 410 errors in the
setup-sandboxtask
Root Cause
The Tasks repo's getAccountSandboxes() only needs snapshot_id and github_repo, but the GET endpoint was making Sandbox.get() for every sandbox record (100+). This caused the newly created sandbox to become unavailable (HTTP 410) by the time setupSandboxTask tried to use it.
Test plan
- Added failing test (TDD RED):
getSandboxStatusshould NOT be called whenmetadataOnlyis true - Implemented fix (TDD GREEN): all 103 sandbox tests pass
- Deploy and verify
setup-sandboxtask no longer fails with 410
š¤ Generated with Claude Code
Summary by CodeRabbit
-
New Features
- Added metadata_only parameter for sandbox retrieval to optimize requests by returning only metadata without live status checks.
-
Bug Fixes
- Improved sandbox creation resilience with automatic fallback when snapshot-based creation encounters errors.
-
Documentation
- Updated organizations API documentation with clearer authentication requirements and refined parameter specifications.