fix: retry transient browser navigation failures#27
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the reliability of the embedded Playwright capture script by retrying page.goto when Chromium returns known transient network/navigation errors, while keeping CAPTCHA/interstitial failures fail-closed. It also adds a regression test to ensure the retry path exists in the script.
Changes:
- Added transient-navigation error classification (
isTransientNavigationError) and a bounded retry wrapper aroundpage.goto(gotoWithTransientRetry). - Updated capture flow to use the retry wrapper for the initial navigation.
- Added a regression test that asserts the retry logic is present in the embedded script.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
internal/provider/provider.go |
Adds transient navigation error detection and a 3-attempt retry around page.goto, then routes initial navigation through it. |
internal/provider/provider_test.go |
Adds a regression test asserting the retry path exists in the embedded Playwright script (and aims to guard interstitial behavior). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
page.gotowhen Chromium reports transient navigation errors such asnet::ERR_NETWORK_CHANGED.Root cause
workflow-compute staging proof run 27072615705 accepted and launched the v0.1.14 product-capture runtime, but the provider exited with:
The provider had no retry around browser navigation, so a transient network transition inside the sandbox failed the whole workload.
TDD proof
With fix absent:
With fix restored:
Verification