Skip to content

fix(browserbase): surface the underlying cause on exhausted retries#3238

Open
tofikwest wants to merge 1 commit into
mainfrom
tofik/browserbase-surface-retry-cause
Open

fix(browserbase): surface the underlying cause on exhausted retries#3238
tofikwest wants to merge 1 commit into
mainfrom
tofik/browserbase-surface-retry-cause

Conversation

@tofikwest

@tofikwest tofikwest commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Why

When a Browserbase/Stagehand call fails all 3 retries, withBrowserbaseRetry threw 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:

Browserbase is temporarily unavailable. Please retry in a moment. (<real cause>)

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.
  • Exhausted-retry path includes the underlying cause in the thrown message.
  • All 16 browserbase session/upstream tests pass; typecheck clean.

🤖 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.

  • Bug Fixes
    • browserbaseUnavailableException(detail?) now appends the provided cause; behavior unchanged when no detail is passed.
    • Exhausted-retry path in BrowserbaseSessionService passes getBrowserbaseErrorText(error) to the exception; tests added to cover both paths.

Written for commit acdfd1e. Summary will update on new commits.

Review in cubic

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
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comp-framework-editor Ready Ready Preview, Comment Jun 22, 2026 9:40pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app Skipped Skipped Jun 22, 2026 9:40pm
portal Skipped Skipped Jun 22, 2026 9:40pm

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant