Repository navigation
Pull CAPTCHA, hosted launch, and database locking into shared abstractions - #41
Open
matthewnanas wants to merge 8 commits into
Open
matthewnanas wants to merge 8 commits into
matthewnanas wants to merge 8 commits into
Conversation
A leftover extension upload id was enough to change hosted launches and disable reusable Contexts. Co-authored-by: Cursor <cursoragent@cursor.com>
Link, 1Password, and the browser locks each owned a slightly different unlock path, so a failed lock could return a broken connection to the pool. Co-authored-by: Cursor <cursoragent@cursor.com>
The service was a second writer for status, inbox, and scan updates, including a create-failure path that could commit only one of its two statements. Co-authored-by: Cursor <cursoragent@cursor.com>
The session and the durable task state each parsed the timeout and kept a second copy of the transition, and the runtime polled every 50ms to join them. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Queue CAPTCHA transitions and commit them inside the running operation. - Keep the private-browser guard and reattach checks independent of the rollout flag. - Re-check cancellation after taking the operation lock, before starting the browser. - Keep secure-login start and CAPTCHA failures redacted. - Restore the monitor pool's 10s idle timeout and drop an unused re-export. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to emit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| runtime.browser = createRuntimeBrowser( | ||
| sessionId, | ||
| runtime.state, | ||
| runtime.captchaTransitions, |
Collaborator
There was a problem hiding this comment.
can we give each replacement browser a fresh CAPTCHA transition queue here and in selectBrowserContext?
if a CAPTCHA starts and errors between tool calls, createBrowserContext closes the old browser but passes its pending events into the replacement. the next snapshot succeeds on the new browser, then draining the old queue marks the task waiting_for_user for a challenge in the closed browser.
i reproduced this locally; the regression test passes at the merge base and fails on this PR. replacing the queue when replacing the browser also keeps late callbacks from the retired browser out of the new queue.
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.
Stack: 1 of 2. This PR is the base; #42 (repo-wide Prettier formatting) sits on top of it.
Summary
server/browser/captcha-gate.tsand the Browserbase launch/reattach/release flow moves toserver/browser/browserbase-launch.ts. All page work, includingwithHostedPageandsecureLogin, now shares one operation lock.onCaptchaTransitioncallback. The runtime queues them and applies them to task state inside the running operation, so they always land on the turn that's running.withAdvisoryLockhelper inserver/postgres.ts, used by the link, 1Password, and private-browser callers. Watch SQL moves ontoMonitorStore.ONEPASSWORD_ENABLEDrollout flag. The private-browser quarantine check and the reattach metadata check still run when the flag is off but the extension is configured. With the flag off, a saved personal session gets replaced instead of reattached.Behavior notes
secureLoginstart and CAPTCHA-gate failures stay redacted ("Secure login failed") and record avault.loginerror trace.markDispatchUnresolvednow runs its two updates in one transaction, so the status change and the reconcile update succeed or fail together.Testing
pnpm lintandpnpm typecheckpass, apart from a local install missingstandardwebhooks, which Add Parallel public-web search #37 added.pnpm test: 393 passed, 61 skipped. New tests cover:tests/monitors.test.ts,tests/monitor-http.test.ts) did not run locally. They need a database and a freshpnpm install.🤖 Generated with Claude Code