Skip to content

[comp] Production Deploy#3205

Open
github-actions[bot] wants to merge 23 commits into
releasefrom
main
Open

[comp] Production Deploy#3205
github-actions[bot] wants to merge 23 commits into
releasefrom
main

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.


Summary by cubic

Ship per-site browser auth profiles and a sturdier browser automation stack. This adds saved login sessions per hostname, stable run outcomes, a task-first auth flow with a live view, and fixes the overview findings filter to include all enabled frameworks.

  • New Features

    • Browser Auth Profiles (per hostname + login identity) backed by Browserbase contexts, with APIs to resolve/create, verify session, mark reauth, and list.
    • Reliable sessions: org-level context coordinator to dedupe; retries for transient context-creation errors; identity-encoded Browserbase responses to avoid premature close; consistent 503 when Browserbase is unavailable.
    • Automation resilience: stable failure codes/stages with a new blocked status; idempotent run creation with attempt counts; per-profile locking and per-domain throttling; fair scheduling caps per org/hostname and a global concurrency limit; smarter evidence-page selection and evaluation fallback; screenshots stored in S3 (upload failures are non-fatal). Optional credential vault adapter; no passwords/TOTP stored.
    • UI: Task-first auth flow (start/verify/reauth from the task); Browser Connection live view embedded in tasks; the Settings “Browser” tab is hidden; profile list with status badges/reasons; clearer run/error states; components moved to @trycompai/design-system.
    • Findings: Overview filter now lists all frameworks enabled for the org (no longer hardcoded to SOC2/ISO27001).
  • Migration

    • Run DB migrations (adds BrowserAuthProfile, failure enums, run fields, and blocked status).
    • Configure env vars: BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID, APP_AWS_ACCESS_KEY_ID, APP_AWS_SECRET_ACCESS_KEY, APP_AWS_REGION, APP_AWS_BUCKET_NAME. Optional: BROWSER_AUTOMATION_GLOBAL_CONCURRENCY, BROWSER_AUTOMATION_DOMAIN_THROTTLE_MS.

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

Review in cubic

@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
app (staging) Ready Ready Preview, Comment Jun 19, 2026 8:32pm
comp-framework-editor (staging) Ready Ready Preview, Comment Jun 19, 2026 8:32pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
portal (staging) Skipped Skipped Jun 19, 2026 8:32pm

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.

8 issues found across 53 files

Confidence score: 2/5

  • apps/api/src/browserbase/browserbase.service.ts in navigateToUrl closes Stagehand/session on successful navigation, which can terminate Live View immediately after the API call and break expected user interaction flows — keep the session open on success and only close on explicit teardown/error paths before merging.
  • apps/app/src/app/(app)/[orgId]/settings/browser-connection/components/BrowserConnectionClient.tsx can let a mount-time profile fetch overwrite an already-established profileId, so auth verification may run against the wrong profile — preserve the session-established profileId once set and ignore later stale overwrites.
  • apps/api/src/browserbase/browser-automation-execution.service.ts and apps/api/src/browserbase/browser-automation-crud.service.ts together create tenant-boundary and response-surface risk: lookups are not org-scoped at query time and run responses include joined internal objects — add organization filters in Prisma where and sanitize output to DTO-only fields before merge.
  • apps/api/src/browserbase/browserbase-session.service.ts and apps/api/src/browserbase/browser-run-coordinator.ts expose stability/operability issues by returning raw internal exception messages to clients and retaining lastDomainRunAt entries without eviction, which can leak internals and grow memory over time — map errors to safe typed exceptions and add cleanup/TTL eviction for inactive domains.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/api/src/browserbase/browser-automation-execution.service.ts">

<violation number="1" location="apps/api/src/browserbase/browser-automation-execution.service.ts:254">
P2: Automation lookup is not tenant-scoped at query time. Filter by organization in Prisma `where` to enforce multi-tenant isolation in the DB layer.</violation>
</file>

<file name="apps/api/src/browserbase/browser-automation-run-result.ts">

<violation number="1" location="apps/api/src/browserbase/browser-automation-run-result.ts:11">
P2: `statusForBrowserFailureCode` duplicates the identical mapping logic already present in the service's private `blockedStatusForCode`. Two independent implementations of the same failure-code-to-status mapping will diverge over time.</violation>
</file>

<file name="apps/app/src/app/(app)/[orgId]/settings/browser-connection/components/BrowserConnectionClient.tsx">

<violation number="1" location="apps/app/src/app/(app)/[orgId]/settings/browser-connection/components/BrowserConnectionClient.tsx:72">
P1: Mount-time profile fetch can overwrite the active session profile ID, causing auth verification to target the wrong profile. Keep existing `profileId` once set by session start.</violation>
</file>

<file name="apps/api/src/browserbase/browser-run-coordinator.ts">

<violation number="1" location="apps/api/src/browserbase/browser-run-coordinator.ts:89">
P2: `lastDomainRunAt` is written but never cleaned up, causing unbounded in-memory growth by hostname. Add eviction/cleanup for inactive domains.</violation>
</file>

<file name="apps/api/src/browserbase/browser-automation-crud.service.ts">

<violation number="1" location="apps/api/src/browserbase/browser-automation-crud.service.ts:114">
P2: Run lookup returns joined automation/task objects directly, leaking internal fields beyond the run DTO. Strip internal relation data before returning API responses.</violation>
</file>

<file name="apps/api/src/browserbase/browser-auth-profile-context.service.ts">

<violation number="1" location="apps/api/src/browserbase/browser-auth-profile-context.service.ts:77">
P2: Timeout handling throws a generic `Error` instead of a Nest timeout exception. Clients get inconsistent status/error semantics for a retryable timeout path.</violation>
</file>

<file name="apps/api/src/browserbase/browserbase.service.ts">

<violation number="1" location="apps/api/src/browserbase/browserbase.service.ts:87">
P1: `navigateToUrl` now closes Stagehand/session on success, ending the live browser session right after navigation. This breaks flows where users must continue interacting in Live View after the API call.</violation>
</file>

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

setProfiles(res.data);
const verifiedProfile = res.data.find((profile) => profile.status === 'verified');
const firstProfile = verifiedProfile ?? res.data[0];
setProfileId(firstProfile?.id ?? null);

@cubic-dev-ai cubic-dev-ai Bot Jun 19, 2026

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.

P1: Mount-time profile fetch can overwrite the active session profile ID, causing auth verification to target the wrong profile. Keep existing profileId once set by session start.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/app/src/app/(app)/[orgId]/settings/browser-connection/components/BrowserConnectionClient.tsx, line 72:

<comment>Mount-time profile fetch can overwrite the active session profile ID, causing auth verification to target the wrong profile. Keep existing `profileId` once set by session start.</comment>

<file context>
@@ -35,23 +53,23 @@ export function BrowserConnectionClient({ organizationId }: BrowserConnectionCli
+        setProfiles(res.data);
+        const verifiedProfile = res.data.find((profile) => profile.status === 'verified');
+        const firstProfile = verifiedProfile ?? res.data[0];
+        setProfileId(firstProfile?.id ?? null);
       }
     } catch {
</file context>
Suggested change
setProfileId(firstProfile?.id ?? null);
setProfileId((current) => current ?? firstProfile?.id ?? null);
Fix with cubic

}
// Don't close - user needs to interact via Live View
async navigateToUrl(sessionId: string, url: string) {
return this.sessions.navigateToUrl(sessionId, url);

@cubic-dev-ai cubic-dev-ai Bot Jun 19, 2026

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.

P1: navigateToUrl now closes Stagehand/session on success, ending the live browser session right after navigation. This breaks flows where users must continue interacting in Live View after the API call.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/api/src/browserbase/browserbase.service.ts, line 87:

<comment>`navigateToUrl` now closes Stagehand/session on success, ending the live browser session right after navigation. This breaks flows where users must continue interacting in Live View after the API call.</comment>

<file context>
@@ -1,403 +1,117 @@
-    }
-    // Don't close - user needs to interact via Live View
+  async navigateToUrl(sessionId: string, url: string) {
+    return this.sessions.navigateToUrl(sessionId, url);
   }
 
</file context>
Fix with cubic

automationId: string;
organizationId: string;
}) {
const automation = await db.browserAutomation.findUnique({

@cubic-dev-ai cubic-dev-ai Bot Jun 19, 2026

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.

P2: Automation lookup is not tenant-scoped at query time. Filter by organization in Prisma where to enforce multi-tenant isolation in the DB layer.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/api/src/browserbase/browser-automation-execution.service.ts, line 254:

<comment>Automation lookup is not tenant-scoped at query time. Filter by organization in Prisma `where` to enforce multi-tenant isolation in the DB layer.</comment>

<file context>
@@ -0,0 +1,276 @@
+    automationId: string;
+    organizationId: string;
+  }) {
+    const automation = await db.browserAutomation.findUnique({
+      where: { id: input.automationId },
+      include: {
</file context>
Fix with cubic

await delay(waitMs);
}

this.lastDomainRunAt.set(hostname, Date.now());

@cubic-dev-ai cubic-dev-ai Bot Jun 19, 2026

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.

P2: lastDomainRunAt is written but never cleaned up, causing unbounded in-memory growth by hostname. Add eviction/cleanup for inactive domains.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/api/src/browserbase/browser-run-coordinator.ts, line 89:

<comment>`lastDomainRunAt` is written but never cleaned up, causing unbounded in-memory growth by hostname. Add eviction/cleanup for inactive domains.</comment>

<file context>
@@ -0,0 +1,93 @@
+      await delay(waitMs);
+    }
+
+    this.lastDomainRunAt.set(hostname, Date.now());
+  }
+}
</file context>
Fix with cubic

async getRunWithPresignedUrl(runId: string, organizationId?: string) {
const run = await db.browserAutomationRun.findUnique({
where: { id: runId },
include: { automation: { include: { task: true } } },

@cubic-dev-ai cubic-dev-ai Bot Jun 19, 2026

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.

P2: Run lookup returns joined automation/task objects directly, leaking internal fields beyond the run DTO. Strip internal relation data before returning API responses.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/api/src/browserbase/browser-automation-crud.service.ts, line 114:

<comment>Run lookup returns joined automation/task objects directly, leaking internal fields beyond the run DTO. Strip internal relation data before returning API responses.</comment>

<file context>
@@ -0,0 +1,203 @@
+  async getRunWithPresignedUrl(runId: string, organizationId?: string) {
+    const run = await db.browserAutomationRun.findUnique({
+      where: { id: runId },
+      include: { automation: { include: { task: true } } },
+    });
+    if (!run) return null;
</file context>
Fix with cubic

Comment thread apps/api/src/browserbase/browserbase-session.service.ts
this.logger.warn(
`Timed out waiting for Browser auth profile context ${profileId}`,
);
throw new Error(

@cubic-dev-ai cubic-dev-ai Bot Jun 19, 2026

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.

P2: Timeout handling throws a generic Error instead of a Nest timeout exception. Clients get inconsistent status/error semantics for a retryable timeout path.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/api/src/browserbase/browser-auth-profile-context.service.ts, line 77:

<comment>Timeout handling throws a generic `Error` instead of a Nest timeout exception. Clients get inconsistent status/error semantics for a retryable timeout path.</comment>

<file context>
@@ -0,0 +1,94 @@
+    this.logger.warn(
+      `Timed out waiting for Browser auth profile context ${profileId}`,
+    );
+    throw new Error(
+      'Browser profile initialization is taking too long. Please retry.',
+    );
</file context>
Fix with cubic

export function statusForBrowserFailureCode(
code: BrowserAutomationFailureCode | undefined,
): 'failed' | 'blocked' {
if (code === 'captcha_blocked' || code === 'needs_user_action') {

@cubic-dev-ai cubic-dev-ai Bot Jun 19, 2026

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.

P2: statusForBrowserFailureCode duplicates the identical mapping logic already present in the service's private blockedStatusForCode. Two independent implementations of the same failure-code-to-status mapping will diverge over time.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/api/src/browserbase/browser-automation-run-result.ts, line 11:

<comment>`statusForBrowserFailureCode` duplicates the identical mapping logic already present in the service's private `blockedStatusForCode`. Two independent implementations of the same failure-code-to-status mapping will diverge over time.</comment>

<file context>
@@ -0,0 +1,39 @@
+export function statusForBrowserFailureCode(
+  code: BrowserAutomationFailureCode | undefined,
+): 'failed' | 'blocked' {
+  if (code === 'captcha_blocked' || code === 'needs_user_action') {
+    return 'blocked';
+  }
</file context>
Fix with cubic

…-profiles

fix(browserbase): request identity encoded api responses
tofikwest and others added 4 commits June 19, 2026 16:03
…down

## Problem
Users can only filter by SOC2 and ISO27001 in the Overview > Findings view, even when their org has other frameworks enabled like ISO42001 or HIPAA. This blocks them from seeing findings specific to those frameworks.

## Root cause
FindingsTab.tsx hardcodes the framework filter options to [all, soc2, iso27001] instead of deriving them from the org's actual enabled frameworks. The CreateFindingSheet on the same page does this correctly via the /v1/frameworks endpoint and extractOrgFrameworkTypes(), but the filter dropdown never got that fix.

## Fix
Apply the same pattern from CreateFindingSheet to FindingsTab: fetch enabled frameworks at component load and use those to populate the filter dropdown. The client-side filter logic and FindingType enum already support all 7 framework types, so this is just surfacing what's already wired.

## Explicitly NOT touched
Finding creation flow (already works correctly). The filter behavior when no frameworks are enabled (edge case, won't happen in practice).

## Verification
✅ org_69d943ca3fbbf2c473e97b0a now shows ISO42001 in the framework filter after enabling it
✅ findings correctly filter when selecting non-SOC2/ISO27001 frameworks
✅ hardcoded filter list replaced with dynamic org config
✅ no regression on existing SOC2/ISO27001 filtering
…-auth-flow

fix(browserbase): make task auth flow primary
@vercel vercel Bot temporarily deployed to staging – portal June 19, 2026 20:25 Inactive
fix(findings): include all enabled frameworks in overview filter dropdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant