Skip to content

fix(desktop-browser): wait for a new tab's first page before calling it blank - #10382

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/desktop-browser-popup-first-load
Nov 24, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/desktop-browser-popup-first-load

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • When the agent clicks a link that opens a new tab or popup, its automation tab moves to that tab, which reports no URL until its first page commits
  • A page tool issued in that window (browser_snapshot, browser_click, …) hit the blank-tab guard in execInPage and failed with "The active tab is blank. Call browser_navigate…", which is wrong: the page is loading, and navigating would throw it away
  • The guard now waits for a blank tab that is still loading its first page (bounded by the tool call's own deadline, and failing on a real load error), then re-checks; a tab that is blank and idle still fails immediately as before
  • This is the intermittent browser-focus.spec.ts desktop-e2e failure ("a popup the agent opens hands focus back to the page the user is in"): its snapshot targets the popup the previous step's agent click opened, and on a slow runner that popup had not committed yet

Type of Change

  • Bug fix

Testing

  • New driver.test.ts case: a snapshot on a tab loading its first page waits and then evaluates; fails on the pre-fix driver (blank-tab error), passes with the fix. The existing blank-and-idle cases still fail immediately
  • apps/desktop/src/main/browser-agent suite (560 tests), desktop type-check, biome
  • desktop-e2e runs browser-focus.spec.ts in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 24, 2026 10:12pm UTC

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.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit b5f98c5 into staging Nov 24, 2026
49 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/desktop-browser-popup-first-load branch November 24, 2026 22:15
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 3/5

[Medium impact] The change affects page tools in the desktop browser-agent workflow.

Fix the snapshot failure and cancellation gap before merging.

Findings

  1. P1 Popup snapshots still fail ▶
  2. P1 Cancelled actions still run ▶

Summary

This PR makes page tools wait when a new tab is blank but still loading.

  • Page tools wait for a popup's first page to load before treating it as blank.

Reviews (1) · Last reviewed commit: "fix(desktop-browser): wait for a new tab..." · Reviewed by Greptile

This branch was previously deployed

1 inactive deployment
Preview — b3b622e6 Deployed Nov 24, 2026 by vercel[bot]
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