Repository navigation
Consolidate observer state reads and retry one connection reset - #4881
Merged
Merged
Conversation
leaf-agent
approved these changes
Nov 1, 2026
max-sixty
pushed a commit
that referenced
this pull request
Nov 5, 2026
The hosted journey's state poll now retries through up to five connection resets instead of one, so a short burst of resets between the runner and Cloudflare's edge no longer fails `publish-site`. This is the repair @max-sixty chose on #4521. `read_state` passes a new `STATE_RESET_RETRIES = 5` to Playwright's native `max_retries`. Playwright retries only `ECONNRESET`, with a backoff that doubles from 250 ms, so one read keeps going through about eight seconds of resets. HTTP failures still surface at once through `answered`, and #4604's socket capture still logs every failed attempt. Why one retry wasn't enough: in [publish-site run 41876972316](https://github.com/max-sixty/leaf/actions/runs/41876972316), request 26 reset on a reused socket after 3.1 s. Playwright's retry then opened a fresh socket, finished the TLS handshake, and reset again after 5.3 s, which used up #4881's single retry. In all three recorded cases the reset came before Workers Observability logged any request, so retrying this idempotent GET is safe. The transport test in `dev/tests/model/test_http_transport.py` now sets the constant to 1, which keeps its exhausted-retry case inside the model tier's 3 s budget. It still checks recovery, exhaustion, HTTP 500 without retry, and credential-free capture. It passes locally (3 passed), and ruff is clean. Closes #4521 Co-authored-by: leaf-agent <[email protected]>
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.
Hosted verification can lose its observer's state request to a connection reset even while browser reads continue. Route every state GET in journey and site verification through one shared helper, using Playwright's native single ECONNRESET retry while preserving request headers, timeouts, response metadata, and HTTP failures.
The transport regression test covers recovery, exhausted recovery, and HTTP 500 without retry, and verifies that failed attempts remain in the existing credential-safe CI capture. Activation, writes, and other resource requests keep their existing behavior. Ref #4521; the origin of the reset remains under investigation.
Validation: 21 focused developer tests, Python type checking, touched-file pre-commit checks, pnpm run check (including runtime and Worker tests), and independent review passed.