fix: browser automation production-review findings (not_relevant guard, credential re-save, connections load state) - #3509
Merged
Conversation
A scheduled browser automation flipped any non-done/non-failed task to done or failed — including tasks a human deliberately marked not_relevant (with a justification). That silently destroyed the compliance decision. Guard both the done and failed transitions with isTaskStatusProtectedFromAutomation, matching the codebase norm (cloud-security skips not_relevant as user intent). +tests.
The status check and the update were separate queries, so a human marking a task not_relevant between them could still be overwritten. Move the guard into the WHERE clause of an atomic updateMany (excluding done/failed + not_relevant), and derive statusChangedToFailed from whether a row actually changed.
Assert the worker's done and failed transitions both go through updateMany with a status filter that excludes not_relevant (and done/failed), and that a zero-count result is treated as no transition — so a regression in either atomic filter is caught instead of silently letting not_relevant be overwritten.
Re-saving a connection's login used to create a brand-new vault item and repoint the profile at it, leaving the superseded item — still holding a real username, password, and TOTP seed — orphaned in the org vault forever (connection deletion only cleans the currently referenced item). Update the existing item in place instead: the op:// reference stays stable, so a scheduled run mid-flight still resolves current secrets, and no stale copies accumulate. A password-only re-save now also keeps the stored authenticator seed (dropping automatic 2FA stays an explicit action via the TOTP endpoints) instead of silently disabling unattended sign-ins. Falls back to creating a fresh item when the stored one is unreadable (e.g. deleted directly in 1Password).
A failed GET /v1/browserbase/profiles left the hook's list empty with no signal, indistinguishable from "no connections yet": the onboarding state invited reconnecting an already-connected vendor, and connection resolution (reconnect mode, composer binding, list status) silently misresolved. Convert useBrowserProfiles to the SWR pattern used by the sibling task hooks: loading and error are now exposed, a failed refresh keeps the last good list, and BrowserAutomations renders a retryable error state instead of the misleading empty states when the initial load fails. fetchProfiles keeps its never-reject contract — callers await it mid-flow (e.g. right after connecting a vendor).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
…hable while loading A failed 1Password write no longer falls back to creating a replacement item: the original still exists, so the fallback would orphan it and repoint the profile — the very leak the update-in-place change removes. Only a failed READ (item deleted directly in 1Password) creates a replacement now; write errors surface to the caller and the retry hits the same item. The profiles loading gate moves below the execution/connect/auth branches, which don't need the list — resuming a connect flow no longer blanks while connections load.
claudfuen
pushed a commit
that referenced
this pull request
Jul 27, 2026
# [3.109.0](v3.108.2...v3.109.0) (2026-07-27) ### Bug Fixes * **api:** don't let scheduled browser runs overwrite not_relevant tasks ([#3507](#3507)) ([99393e5](99393e5)) * browser automation production-review findings (not_relevant guard, credential re-save, connections load state) ([#3509](#3509)) ([02746c3](02746c3)) ### Features * browser automations for scheduled, credential-backed evidence capture ([#3417](#3417)) ([411a83b](411a83b))
Contributor
|
🎉 This PR is included in version 3.109.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Fixes for findings from the browser-automations production review (follow-ups to #3417).
Scheduled runs vs human task decisions
not_relevant— the guard is an atomic conditional update (status NOT INin the WHERE clause), so a concurrent human decision can't be clobbered between a read and a write. Worker-level tests cover both the done and failed transitions.Credential re-save keeps the vault tidy
op://reference stays stable — a scheduled run mid-flight resolves current values — and superseded items no longer accumulate in the org vault.Connections list: loading/error are no longer rendered as "no connections"
useBrowserProfilesnow uses the same SWR pattern as the sibling task hooks, exposingisLoading/isErrorand keeping the last good list when a refresh fails.BrowserAutomationsshows a retryable error card when the initial connections load fails, instead of the onboarding/empty states (which invited reconnecting an already-connected vendor and misresolved connection status in the composer and list). The connect and auth flows stay reachable — they don't depend on the list.Tests
apps/api:npx jest src/browserbase src/trigger— credential-storage suite 12/12 (4 new re-save cases), worker guard tests pass.apps/app: task-page browser-automations suites 96/96, incl. 4 newuseBrowserProfilescases.main, in untouched files).Summary by cubic
Fixes production-review issues in browser automations: scheduled runs can’t overwrite human “not relevant” decisions, credential re-saves update the existing 1Password item with stable
op://references, and connection list load failures show a retryable error without blocking flows.not_relevant,done, andfailed, so human decisions aren’t clobbered.useBrowserProfilesswitches to SWR withisLoading/isError, keeps the last good list on refresh failures, and the UI renders a retryable error card on initial load failure; execution/connect/auth flows remain accessible while the list loads.Written for commit d6e1678. Summary will update on new commits.