Repository navigation
feat(browser): add browser login handoff tool for CAPTCHA/2FA sign-in - #137
Conversation
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
|
I'll analyze this and get back to you. |
There was a problem hiding this comment.
All reported issues were addressed across 18 files
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 9 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Adds a bundled browser-handoff extension exposing a browser_handoff tool with request_login/status/attach actions, so an agent can hand a login/CAPTCHA/2FA wall off to the customer via a hosted browser session instead of dead-ending, then reuse the resulting session as a browser profile. The customer always enters their own credentials; the tool never touches them. Also adds a browser-profile-config plugin-sdk facade (mirroring the existing browser-maintenance bundled-facade pattern) so a sibling plugin can register a remote-CDP browser profile without reaching into the browser extension's internals, and routes the browser-automation skill's login/CAPTCHA/2FA dead-end to the new tool.
… drift - Regenerate pnpm-lock.yaml for the new extensions/browser-handoff workspace entry (was the root cause of every CI job failing on frozen-lockfile). - registerRemoteCdpBrowserProfile: validate cdpUrl with parseBrowserHttpUrl before persisting, and delete-then-create so re-attaching an expired session on the same site replaces the profile instead of hitting the create-only conflict error. - pollBrowserHandoffStatus: reject a ready status that omits profile_name instead of reporting success on a handoff that can never be attached. - requestBrowserLoginHandoff: send a stable Idempotency-Key across retries so a 5xx retry cannot mint two handoffs; treat thrown network errors (not just 5xx responses) as retryable. - Move browser_handoff argument parsing into tool.ts so invalid action/site produce the same "browser-handoff error:" text result as every other failure path, instead of a raw thrown tool-call error. - Document the new plugin-sdk/browser-profile-config subpath in docs/plugins/sdk-subpaths.md.
…y, deps) - tool.ts: BrowserHandoffToolTextResult was missing the required `details` field on AgentToolResult<T>, which tsgo caught as a real type error. - boon-core-client.ts: replace raw fetch() with fetchWithSsrFGuard (required for outbound channel/plugin runtime calls per scripts/check-no-raw-channel-fetch.mjs), scoped to the request's own hostname via ssrfPolicyFromHttpBaseUrlAllowedHostname. - package.json: declare typebox as a runtime dependency (schema.ts imports it), which extension-runtime-dependencies.contract.test.ts caught as an undeclared runtime import; regenerate pnpm-lock.yaml accordingly. - Fix 3 oxlint errors (eslint(curly), 2x typescript(no-unnecessary-type-assertion)) surfaced once CI's lockfile drift was no longer masking every other check.
An unrelated PR (boon HEAD) landed after this branch forked and already bumped these same budgets for its own change. Rebasing picked up that baseline; bump it further by exactly this branch's own footprint (1 new public entrypoint, 3 exports, 2 callable) from adding plugin-sdk/browser-profile-config.
e6693a5 to
5a4b7d7
Compare
- createBrowserProfileConfig: add replaceExisting to overwrite a profile in the same mutateConfigFile transaction instead of the caller deleting it first. A failed replacement (invalid endpoint, exhausted ports) now leaves the existing working profile untouched rather than deleting it and returning an error with nothing left; browser.defaultProfile is never touched by this path either way. - registerRemoteCdpBrowserProfile: use replaceExisting instead of delete-then-create. - boon-core-client.ts: propagate AbortError/an already-aborted signal as-is instead of wrapping it as a retryable error, so a caller-initiated cancellation doesn't burn two extra retry attempts.
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
createBrowserProfileConfig's replaceExisting path still counted the about-to-be-replaced entry's color as "used" when allocating a fresh one, so the same named profile picked a new accent color on every reattach. Reuse the existing profile's color when replacing, unless the caller passes an explicit color.

What Problem This Solves
Today an agent dead-ends whenever a target site needs login, CAPTCHA, or 2FA:
the browser-automation skill explicitly tells the model to stop and report the
manual step. The customer has no way to hand a session over, so the whole task
halts.
Why This Change Was Made
Adds a bundled
browser-handoffextension exposing abrowser_handoffagenttool (
request_login/status/attach). The agent mints a hostedsign-in link via boon-core, shares it with the customer, and the customer
signs in themselves (CAPTCHA/2FA happen on that hosted page, never in front of
the agent). Once done, the resulting session is registered as a reusable
browserprofile so later runs need no human until the site's sessionexpires.
Key boundary: the tool never touches credentials — the human is always the one
who signs in. The Anchor vendor API key never leaves boon-core; the agent host
only ever gets a proxied session reference (never a raw
cdp_url, which wouldembed that key). The agent host does send
BOON_API_KEYas a Bearer credentialto boon-core's
browser_handoffendpoints, but that is the same generic,already-provisioned boon-core credential every agent host already carries for
other outbound calls (matching the
anychat-boon-webtransport precedent) —not a new secret, and not the Anchor key.
Because
browser.profiles.*is core-owned/.strict()and a plugin cannotimport another extension's
src/**, this also adds a smallbrowser-profile-configplugin-sdk facade (mirrors the existingbrowser-maintenancebundled-facade pattern) sobrowser-handoffcanregister/remove a remote-CDP browser profile without reaching into the
browserextension's internals.Non-goal for this PR: the boon-core side (the broker service,
BrowserProfilemodel, and the actual
/api/v1/agent/browser_handoff/*endpoints this clientcalls) lives in a separate repo and is out of scope here.
User Impact
Agents can now hand off login-walled sites (e.g. construction bidding/plan-room
platforms) to the customer instead of silently stopping. Nothing changes for
sites that don't hit this path.
Evidence
node scripts/run-vitest.mjs extensions/browser-handoff— 14 tests coveringthe boon-core client (request/status wire format, error envelopes, retry
behavior) and the full tool orchestration (request_login → status → attach,
including the no-prior-handoff and already-attached error paths).
node scripts/run-vitest.mjs extensions/browser/index.test.ts— existingbrowser extension suite still green (14 tests) after adding
browser-profile-mutations.ts.node scripts/run-vitest.mjs src/plugin-sdk/facade-runtime.test.ts src/plugin-sdk/facade-loader.test.ts— facade loader/runtime contracts unaffected (22 tests).node scripts/run-vitest.mjs src/plugins/bundled-plugin-metadata.test.ts— bundled plugin manifest/discovery still green (35 tests), confirming the new plugin's manifest is valid and needs no hardcoded id-list update.node scripts/check-plugin-sdk-subpath-exports.mjsandnode scripts/sync-plugin-sdk-exports.mjs --check— newbrowser-profile-configSDK subpath is correctly wired end-to-end.tsgotypecheck and the fullpnpm check:changedgate — this worktree has no installednode_modulesand Crabbox isn't configured in this environment (no Azure CLI/credentials). Flagging as an open gap for CI/reviewer follow-up rather than claiming it passed.Summary by cubic
Adds the bundled
browser-handoffextension exposing abrowser_handofftool to hand login/CAPTCHA/2FA to the customer and reuse the session as abrowserprofile. Previously the agent dead‑ended on login walls; now it can mint a sign‑in link (request_login), check progress (status), and attach a remote CDP session (attach). Credentials never pass through the agent; sites without login behave unchanged.browser-handoffplugin with a flat tool schema and in‑tool argument parsing for consistent error text.BOON_API_KEYBearer auth, SSRF‑guarded fetch, a stable Idempotency‑Key, and retries for network/5xx; propagates AbortError without retry;statusrejects “ready” withoutprofile_name.plugin-sdk/browser-profile-configand abrowserpublic surface to register/unregister remote‑CDP profiles;registerRemoteCdpBrowserProfilevalidatescdpUrl, replaces existing profiles atomically to support re‑attach, preserves the existing profile anddefaultProfileon failure, and preserves the profile’s color on replace unless explicitly overridden.browser-automationskill to usebrowser_handoffinstead of dead‑ending.plugin-sdk/browser-profile-configand updates the lockfile for the new workspace and runtime dependency.Rollout
browser-handoffplugin (disabled by default).plugins.entries.browser-handoff.config.boonCoreBaseUrl(e.g., https://app.getboon.ai).BOON_API_KEYin the agent runtime environment.browserplugin is active soregisterRemoteCdpBrowserProfileis available.Written for commit 3a4c69a. Summary will update on new commits.