Uh oh!
There was an error while loading. Please reload this page.
fix(e2e): dynamically calculate DigitalOcean parallel capacity from account limit - #2518
Conversation
…ccount limit Previously, _digitalocean_max_parallel() always returned 3, assuming all quota slots were available. When pre-existing droplets occupy slots, the batch-3 parallel runs fail with "droplet limit exceeded" API errors. Now queries /v2/account for the actual droplet_limit and subtracts the current droplet count to compute available capacity. Falls back to 3 if the API is unreachable. -- qa/e2e-tester
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: 1dd6c0c
Findings
No critical or high-severity issues found. Two low-severity observations that are acceptable:
- LOW sh/e2e/lib/clouds/digitalocean.sh:367 — Theoretical integer overflow in
wc -loutput, mitigated by API pagination (200/page max) and practical droplet limits - LOW sh/e2e/lib/clouds/digitalocean.sh:368 — Arithmetic could produce negative values if API returns inconsistent data, but handled by minimum-of-1 guard on lines 369-370
Security Assessment
✓ Command injection: Clean - no user input, all data from trusted DigitalOcean API
✓ Credential leaks: Clean - uses _do_curl_auth wrapper with temp file (chmod 600), token never in ps output
✓ Injection safety: Clean - fixed regex patterns, quoted arithmetic expansions
✓ Error handling: Robust - all API calls have fallback to safe default (3)
✓ API response validation: Adequate - uses grep with fixed patterns, handles missing/malformed responses
✓ Integer overflow/underflow: Low risk - bounded by API pagination and practical limits
Tests
- bash -n: PASS
- bun test: PASS (1396 tests, 0 failures)
- curl|bash: N/A (library function)
- macOS compat: OK (uses
printf,$(( )), no bash 4+ features)
Code Quality
The implementation is well-structured with appropriate fallbacks and error handling. The dynamic capacity calculation is a significant improvement over the hardcoded limit, reducing E2E test failures when pre-existing droplets consume quota slots.
-- security/pr-reviewer
Uh oh!
There was an error while loading. Please reload this page.
…ccount limit (OpenRouterLabs#2518) Previously, _digitalocean_max_parallel() always returned 3, assuming all quota slots were available. When pre-existing droplets occupy slots, the batch-3 parallel runs fail with "droplet limit exceeded" API errors. Now queries /v2/account for the actual droplet_limit and subtracts the current droplet count to compute available capacity. Falls back to 3 if the API is unreachable. -- qa/e2e-tester Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
…ccount limit (OpenRouterLabs#2518) Previously, _digitalocean_max_parallel() always returned 3, assuming all quota slots were available. When pre-existing droplets occupy slots, the batch-3 parallel runs fail with "droplet limit exceeded" API errors. Now queries /v2/account for the actual droplet_limit and subtracts the current droplet count to compute available capacity. Falls back to 3 if the API is unreachable. -- qa/e2e-tester Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
…ccount limit (OpenRouterLabs#2518) Previously, _digitalocean_max_parallel() always returned 3, assuming all quota slots were available. When pre-existing droplets occupy slots, the batch-3 parallel runs fail with "droplet limit exceeded" API errors. Now queries /v2/account for the actual droplet_limit and subtracts the current droplet count to compute available capacity. Falls back to 3 if the API is unreachable. -- qa/e2e-tester Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
Summary
_digitalocean_max_parallel()always returned 3, but pre-existing droplets consume quota slots and cause "droplet limit exceeded" errors when tests run 3-in-parallel/v2/accountfor the actualdroplet_limitand subtracts current droplet count to compute available capacityRoot Cause
The QA account has a 3-droplet limit. During this E2E run, a
spawn-5v48droplet (created 2026-03-11) occupied 1 of 3 slots. Batch 1 tried to create 3 droplets (claude, openclaw, zeroclaw) in parallel — the 3rd slot was already taken, causing claude to fail. Same pattern caused opencode to fail in batch 2.Test plan
_digitalocean_max_parallelreturns 2 when 1 droplet exists on a 3-limit account-- qa/e2e-tester