Skip to content

fix(desktop-browser): give a wait's closing snapshot a full budget and confirm ref reuse names the same element - #9966

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/browser-wait-observe-budget
Nov 13, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/browser-wait-observe-budget

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Final-review follow-ups for the browser-agent changes in this release:

  • browser_wait_for now ends with a snapshot, but its native watchdog still allowed only 5s after the wait. A wait that ran to its timeout on a heavy page could lose its closing observation and invalidate refs, where before it returned found: false with refs intact. The watchdog now adds a standalone snapshot's 20s budget; the renderer's wait budget (queue wait + timeout + 15s) still covers it
  • Ref reuse also requires the stored entry to point at the same element (defensive: a page's id counter only grows per document, so this should be unreachable today; it keeps reuse correct if that ever changes)
  • Rename a local in browser_wait_for that shadowed the module-level elementTarget

Type of Change

  • Bug fix

Testing

  • Red/green: 'gives a wait that runs to its timeout a full snapshot budget for its closing observation' fails on staging with the observation timed out, passes with the fix; watchdog expectations updated for the new budget
  • 548 browser-agent tests pass, desktop type-check clean

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 13, 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 13, 2026 1:03am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues remain.

Summary

Gives browser_wait_for a full budget for its closing snapshot and requires reused refs to name the same element.

  • Browser waits get enough time to return their closing snapshot.
  • Snapshot refs stay with the element that first received them.
  • The wait calls its element page target waitTarget.

Reviews (3) · Last reviewed commit: "test(mothership): expect the wider brows..." · Reviewed by Greptile

@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.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@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 4 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

Comment thread packages/browser-protocol/src/index.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@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 6 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

This branch was previously deployed

1 inactive deployment
Preview — 2d10152c Deployed Nov 13, 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