Repository navigation
Conversation
…nnects While a sandbox's tunnel client reconnects, its edge answers 404 (no client registered) or 502-504, and the chat program retried only transport errors outside the request itself, so every rollout with a model call in flight exited 1. Retry those statuses and transport errors, request included, for at least two minutes; the interception server's digest replay guard keeps a retried call to one turn. Claude-Session: https://claude.ai/code/session_01PEUKiKSBdkzvBp88ioqLRK
nxphi47
marked this pull request as ready for review
December 4, 2026 22:31
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Model calls now retry through tunnel reconnects, covering both request setup and interrupted streams. Existing replay protection is retained; the main behavioral tradeoff is longer waiting before persistent failures surface. You can add or adjust custom eligibility rules. Learn more. |
This branch has not been deployed
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.
While a sandbox's tunnel client reconnects, the tunnel edge answers 404 (no client registered for the route) or 502–504. The bash harness's
chat()retried only transport errors raised while reading the stream, so any rollout with a model call in flight during a reconnect exited with status 1.This PR:
chat.completions.createrequest inside the retry, so request setup is retried too;stop_after_attempt(max_retries + 1) & stop_after_delay(120)), long enough to ride out a reconnect.The interception server's digest replay guard keeps a retried call to a single turn.
Note
Retry bash harness model calls through tunnel reconnects via
_is_tunnel_gapThe bash harness in core.py retried only connection/transport errors, so tunnel reconnects surfaced as API status errors (404, 502, 503, 504) and failed the run.
_is_tunnel_gap, a Tenacity retry predicate that treats those API status codes plus connection and transport errors as retryable.Macroscope summarized 0b74310.