{{ message }}
Repository navigation
fix(javascript): bound readiness polling sleeps - #1745
Merged
Pangjiping merged 3 commits intoSep 7, 2026
Merged
Conversation
waitUntilReady slept a full pollingIntervalMillis after every failed health check, even when the remaining timeout budget was smaller. With readyTimeoutSeconds=0.02 and healthCheckPollingInterval=2000 a never-ready sandbox took ~2s to reject with SandboxReadyTimeoutException instead of ~20ms. Clamp the sleep to the remaining budget and exit once it is exhausted, mirroring the Python fix in opensandbox-group#1734. The timeout message and attempt count are unchanged. Part of opensandbox-group#1739 (JavaScript SDK) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
7487
requested review from
Pangjiping,
hittyt,
jwx0925 and
ninan-nn
as code owners
September 7, 2026 10:58
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43453103d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
After the clamped sleep wakes at exactly the deadline, a strict `>` comparison still allowed one more health check past the budget. Use `>=` so the loop exits at the deadline, matching the strict before-deadline loops in the Python, Go, and Kotlin SDKs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
6 of 11 tasks
12 of 14 tasks
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.

Summary
waitUntilReadyslept a fullpollingIntervalMillisafter every failed health check even when less time remained in the timeout budget, so withreadyTimeoutSeconds=0.02/healthCheckPollingInterval=2000a never-ready sandbox took ~2s to reject withSandboxReadyTimeoutExceptioninstead of ~20ms.min(pollingIntervalMillis, deadline - now)and exit the loop once the budget is exhausted (same approach as the Python fix in fix(python-sdk): bound readiness polling sleeps #1734). The two exit points now share onethrow, so the timeout message, attempt count, and abort behavior are unchanged.Go SDK: #1744. Kotlin / C# are left for separate PRs.
Testing
Added
Sandbox.create readiness timeout does not overshoot by a polling intervalintests/sandbox.create.test.mjs(ping always returns false, timeout 20ms, interval 2s). Before the fix:expected timeout in ~20ms, took 2003ms; after: passes in ~22ms.pnpm run lint,pnpm run typecheck, andpnpm run test(129/129) pass insdks/sandbox/javascript.Breaking Changes
Checklist
🤖 Generated with Claude Code