fix: do not mark runs FAILED on transient sandbox API errors - #299
Open
nishant-uxs wants to merge 1 commit into
Open
fix: do not mark runs FAILED on transient sandbox API errors#299nishant-uxs wants to merge 1 commit into
nishant-uxs wants to merge 1 commit into
Conversation
Distinguish absent sandboxes from rate limits, timeouts, and 5xx so the watchdog leaves RUNNING and retries instead of false-failing. Fixes OpenHands#285
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.
Problem
get_sandbox_agent_urlcollapsed every sandbox-API exception intoNone("absent"). The watchdog then marked the runFAILEDwithTimed out: Sandbox not available. HTTP 429, timeouts, and 5xx carry no information about sandbox liveness — during the #291 incident this false-failed live customer runs.Root cause
Watchdog tick (past
timeout_at) →backend.verify_run→get_sandbox_agent_urlcaughtExceptionand returnedNone, so 429 / timeout / 5xx looked identical to "sandbox gone", thenFAILED.Broken invariant: "couldn't check" is not the same as "sandbox gone".
Solution
Minimal semantics fix (no watchdog redesign / no new retry policy):
SandboxLookupTransientErrorfor 429, 5xx, and transport failures (404 / empty list still mean absent).VerificationResult.retryablefor transient lookup failures.retryable, leaveRUNNINGfor the next tick.Failure-state diagram
Test plan
pytest tests/test_sandbox_lookup_semantics.py— 11 passedFixes #285