Skip to content

fix: retain the browser ID when a Cloud stop fails - #3

Open
MagMueller wants to merge 1 commit into
mainfrom
agency/eve-stop-failure-20260907
Open

fix: retain the browser ID when a Cloud stop fails#3
MagMueller wants to merge 1 commit into
mainfrom
agency/eve-stop-failure-20260907

Conversation

@MagMueller

@MagMueller MagMueller commented Sep 7, 2026

Copy link
Copy Markdown

What changes

Only treat an SDK BrowserUseError with HTTP 404 as an already-gone browser. Propagate other stop failures.

The stop tool already waits for this helper before removing .bu-browser-id. Propagating an error keeps the ID available for another stop attempt and avoids returning {ok:true, stopped:id} when the request failed. The tool implementation does not change.

Reproduction

The published @browser_use/eve@0.0.4 stop export and shared Cloud chunk are byte-identical to the current main build. With the published package installed, a local HTTP 503 response produces {ok:true, stopped:id} and deletes the ID. Calling the same tool again, without restoring the file, returns No cloud browser was open. and sends no request.

With this patch, the same 503 raises BrowserUseError and keeps the ID. A second call uses that same ID, receives the local HTTP 200 response and clears the file.

Validation

  • Exercised the installed package export, real eve.defineTool, and real browser-use-sdk HTTP parsing and retries. Requests were redirected to a loopback HTTP server; the sandbox adapter ran the tool's exact cat/rm commands against owned temporary files.
  • Checked fixed local package artifacts with SDK 3.8.4 and 3.11.3. HTTP 401/403/422/500/503, dropped connections, exhausted 429 retries and a missing key now surface errors and preserve the ID.
  • HTTP 200, documented 404, no-ID/no-key no-op, and the SDK's 429-then-200 retry behavior stay unchanged. The .bu-cdp fixture stays unchanged.
  • The published package fails the fixed contract at unauthorized401 must reject.
  • Local build, typecheck, test suite, changed-test TypeScript check and diff check pass on Node 26. Repository CI uses Node 24.

Scope and limits

No live Cloud browser or hosted Eve sandbox was used. This proves local tool behavior, not a remote stop or billing outcome. The 404 exception uses the SDK error type and status, not exact response-body text.

No new retry policy, dependency change, package version, provisioning, release default, scaffold change or sandbox file-I/O error handling is included.


Summary by cubic

Fixes the Cloud stop flow so a failed stop request no longer deletes the browser ID. Previously any stop error was swallowed and the ID was removed, so a retry returned No cloud browser was open. without making a request. Now only an SDK BrowserUseError with HTTP 404 is treated as already gone; other failures propagate and keep the ID for another attempt.

Bug Fixes

  • Missing API key now throws before calling the SDK instead of silently succeeding.
  • Added loopback-server tests covering HTTP 401/403/422/500/503, dropped connections, and the existing 429 retry path.

Written for commit 78b69a2. Summary will update on new commits.

Review in cubic

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 3 files

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