fix(browserbase): surface the underlying cause on exhausted retries#3238
Open
tofikwest wants to merge 1 commit into
Open
fix(browserbase): surface the underlying cause on exhausted retries#3238tofikwest wants to merge 1 commit into
tofikwest wants to merge 1 commit into
Conversation
When retries are exhausted, withBrowserbaseRetry threw a generic "Browserbase is temporarily unavailable" that hid the real upstream error. Append the underlying error text to the message so an exhausted retry is diagnosable from the UI/response, not only the server logs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013zSwXMqVNvWLJBZEot9x12
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Why
When a Browserbase/Stagehand call fails all 3 retries,
withBrowserbaseRetrythrew a generic "Browserbase is temporarily unavailable. Please retry in a moment." — which hides the real upstream error. We hit this repeatedly while debugging the connect flow: the message tells the user (and us) nothing about what actually failed, forcing a server-log hunt every time.Change
browserbaseUnavailableException(detail?)now appends the underlying error text when provided, and the retry-exhaustion path passes it through:So an exhausted retry is diagnosable straight from the UI/response — e.g.
(... : Premature close)or(Stagehand connect timeout ...)— instead of being opaque. Non-retryable errors are unchanged (they already surface their own message). The no-detail call site keeps the original message.Follow-up to #3225 (init retry) and #3230 (disableAPI). Builds on both.
Tests
browserbaseUnavailableException('Premature close')includes the detail.🤖 Generated with Claude Code
https://claude.ai/code/session_013zSwXMqVNvWLJBZEot9x12
Summary by cubic
Surfaces the underlying upstream error when Browserbase retries are exhausted by appending the cause to the "temporarily unavailable" message. This makes failures diagnosable from the UI/response without digging through server logs.
browserbaseUnavailableException(detail?)now appends the provided cause; behavior unchanged when no detail is passed.BrowserbaseSessionServicepassesgetBrowserbaseErrorText(error)to the exception; tests added to cover both paths.Written for commit acdfd1e. Summary will update on new commits.