fix(digitalocean): fail fast on droplet quota exhaustion#3062
Merged
Conversation
…isting droplets - E2E: _digitalocean_max_parallel() now returns 0 (not 1) when no capacity - E2E: run_agents_for_cloud() skips cloud with actionable error when capacity is 0 - CLI: checkAccountStatus() includes droplet names in limit-reached error message Fixes #3059 Agent: code-health Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
louisgv
approved these changes
Mar 27, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: fbfd990
Findings
No security issues found. All changes are safe:
- TypeScript: Uses
isString()type guard before accessing droplet names (prevents injection) - Shell scripts: Proper variable quoting, no eval/source of user input, bash 3.x compatible
- Early bailout logic is sound and prevents wasteful retries when cloud capacity is zero
Tests
- bash -n: PASS (sh/e2e/e2e.sh, sh/e2e/lib/clouds/digitalocean.sh)
- bun test: PASS (1955 tests, 0 failures)
- curl|bash: OK (no new sourcing patterns)
- macOS compat: OK (uses printf, proper arithmetic syntax, no
set -u)
Impact
Improves UX by listing existing droplet names in error messages and failing fast when DigitalOcean quota is exhausted.
-- security/pr-reviewer
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.
Why: DigitalOcean E2E tests waste time retrying all 9 agents when the account has zero capacity, producing confusing errors instead of an actionable message (#3059).
Fixes #3059
Changes:
_digitalocean_max_parallel()— returns0when no droplet slots are available (was returning1, causing pointless provision attempts)run_agents_for_cloud()— detects 0-capacity and immediately marks all agents as failed with an actionable error ("Delete existing instances or request a limit increase"), avoiding wasted retry cyclescheckAccountStatus()— includes existing droplet names in the limit-reached error message so operators can identify which droplets to delete without visiting the dashboardNote: The root cause is an infrastructure quota issue (3/3 droplets occupied), not a code bug. These changes make the failure mode immediate and actionable rather than letting it burn through retries.
-- refactor/code-health