Skip to content

fix: avoid duplicate live handoff widgets - #626

Merged
Xrazik1 merged 2 commits into
mainfrom
fix/single-handoff-widget
Dec 4, 2026
Merged

Xrazik1 merged 2 commits into
mainfrom
fix/single-handoff-widget

Conversation

@andyMrtnzP

@andyMrtnzP andyMrtnzP commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Human handoffs currently open an empty app container before the working viewer. Remove widget metadata from browserless_live_url so preparation, status, page listing, and close calls stay JSON-only. browserless_show remains the sole handoff renderer.

Direct inline viewers move to browserless_create_live_url, a full-HTTP tool that accepts the existing creation options without an action parameter. Existing browserless_live_url create calls still return viewer links as JSON. Both creation paths share validation and defaults.

Test plan

  • Regression reproduced on the original code: handoff preparation incorrectly advertises a UI resource.
  • Focused MCP and headless Chrome checks cover handoff pause/resume, viewer rendering, lifecycle results, JSON fallback, and tool-surface metadata.
  • npm test on Node 26: 2,225 passing, 2 pending.
  • Explicit headless Chrome/MCP regression run: 107 passing, including the browser tests skipped by the default run.
  • Build, formatting, and npm run lint pass.
  • Browser tests use local fixtures; no production browser session was used.

Checklist

  • Conventional commit subjects.
  • Updated viewer usage documentation.
  • No new dependencies.

Summary by CodeRabbit

  • New Features
    • Added a dedicated tool for creating live viewers, with inline viewing available in compatible clients and a viewer URL returned for other clients.
  • Updates
    • Live URL lifecycle actions, including status and close, return JSON without opening a viewer or empty window.

@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds browserless_create_live_url for inline viewer creation. The existing browserless_live_url tool returns JSON for all actions and no longer advertises viewer UI metadata. Documentation and tests reflect the updated tool contracts.

Changes

Live viewer tool behavior

Layer / File(s) Summary
Dedicated inline creation tool
src/tools/live-url.ts
A shared creation function parses create parameters, applies defaults and PNG quality validation, and creates the link. The new tool uses this function and renders the viewer when inline rendering is enabled.
JSON-only live URL actions
src/tools/live-url.ts
The existing tool removes viewer metadata and delegates create actions with inline rendering disabled. Its other action handling remains in place.
Tool contract coverage and documentation
README.md, test/integration/handoff-widget.spec.ts, test/integration/live-url-widget.spec.ts, test/integration/replay-widget.spec.ts, test/integration/server.spec.ts, test/tools/annotations.spec.ts, test/tools/compliance-mode.spec.ts
The README and tests reflect the dedicated creation tool, tool metadata, fallback results, and updated tool counts.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: artiom, xrazik1

Merge Risk: Minimal · up to 71c14

This change stops handoff calls from opening empty widget windows and adds a dedicated tool for inline live viewers. The existing live URL tool keeps returning JSON. No concrete merge-blocking risk was identified, and the tool contracts are covered by updated tests and documentation.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix: avoid duplicate live handoff widgets" matches the main change. The PR removes widget metadata from browserless_live_url so handoff preparation, status, page listing, and close calls re…
Description check Passed The description covers the summary, the test plan, and the checklist. It explains the problem (empty app container before the viewer), the fix (widget metadata removed from browserless_live_url), and …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix: avoid duplicate live handoff widgets" matches the main change. The PR removes widget metadata from browserless_live_url so handoff preparation, status, page listing, and close calls return JSON only. browserless_show remains the sole handoff renderer, and a new browserless_create_live_url tool carries the inline viewer. The title names the bug fix and the handoff widget focus, and it uses a conventional commit prefix. It does not mention the new creation tool, which is a secondary detail.

Full details: Description check

Explanation

The description covers the summary, the test plan, and the checklist. It explains the problem (empty app container before the viewer), the fix (widget metadata removed from browserless_live_url), and the new browserless_create_live_url tool. The test plan lists the regression reproduction and the test runs with results, and it notes the lint and build checks. The Related issues section is missing: it has no Closes or Refs reference, although the PR is #626. The checklist items are written as plain statements rather than checkboxes, and the 'Changes' section is omitted, which the template allows when the summary is enough. The test plan does not use the template's checkbox list.

Resolution

Optional improvements: add the issue reference under Related issues (for example, Closes or Refs with the issue number, if one exists). Restore the template checkboxes in Test plan and Checklist so each item reads as checked or unchecked.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit taps a tool to make a view,
A viewer opens when the new call comes through.
The older route returns JSON in hand,
While lifecycle calls keep to their plan.
The burrow tests confirm each path is true.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: a816e38c-e115-4b39-b134-94b22887f09e
Commits

Reviewing files that changed from the base of the PR and between 2ad3799 and 71c1489.

Files selected for processing: 8

  • README.md
  • src/tools/live-url.ts
  • test/integration/handoff-widget.spec.ts
  • test/integration/live-url-widget.spec.ts
  • test/integration/replay-widget.spec.ts
  • test/integration/server.spec.ts
  • test/tools/annotations.spec.ts
  • test/tools/compliance-mode.spec.ts

Included review availability: This review used your included allowance. 5 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.

@andyMrtnzP
andyMrtnzP marked this pull request as ready for review December 4, 2026 16:49
@Xrazik1
Xrazik1 merged commit 86f32b5 into main Dec 4, 2026
12 checks passed
@Xrazik1
Xrazik1 deleted the fix/single-handoff-widget branch December 4, 2026 17:04
andyMrtnzP pushed a commit that referenced this pull request Dec 4, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.53.2](v1.53.1...v1.53.2)
(2026-12-04)


### Bug Fixes

* avoid duplicate live handoff widgets
([#626](#626))
([86f32b5](86f32b5))
* return smartscraper screenshot first and drop HTML when only
screenshot is requested
([#628](#628))
([51e328f](51e328f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: browserless-actions-bot[bot] <186328842+browserless-actions-bot[bot]@users.noreply.github.com>
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.

2 participants