Skip to content

Add an example that checks a remote Chrome checkpoint across runs - #171

Open
laotoutou wants to merge 1 commit into
triggerdotdev:mainfrom
laotoutou:cloudbrowser-checkpoint
Open

laotoutou wants to merge 1 commit into
triggerdotdev:mainfrom
laotoutou:cloudbrowser-checkpoint

Conversation

@laotoutou

@laotoutou laotoutou commented Dec 2, 2026 •

Copy link
Copy Markdown

This example accompanies the failure recovery guide for workflows that reconnect to an existing Chrome profile. One schema task writes or verifies a namespaced localStorage marker. Each attempt opens and closes its own fixture tab, and repeated writes for the same checkpoint produce the same state. A check for a missing checkpoint returns present: false so the caller can stop before a dependent action.

The fixture uses a reserved hostname fulfilled by Playwright. The WSS grant is supplied through the runtime environment, and the example requires no local Chromium install.

Verification

  • npm run typecheck passed with Trigger.dev SDK 4.9.0 and Playwright Core 1.65.2.
  • Tested the shared helper against an isolated Cloudbrowser Chrome with website networking blocked. Separate CDP connections confirmed missing and existing checkpoints, an idempotent repeat write, and key isolation.
  • Explicitly paused and resumed the fixture browser. The original grant connected to the new runtime generation, and a fresh tab read the stored marker. The temporary browser was deleted and the lookup returned 404.
  • The hosted Trigger.dev worker path remains untested.

I work on Cloudbrowser and used AI assistance to prepare this contribution.

Summary by CodeRabbit

  • New Features
    • Added a Cloudbrowser example that saves browser state in one run and checks that it persists in a later run.
  • Documentation
    • Added setup and usage instructions, including how to test persistence across a pause and resume, understand missing checkpoints, and clean up afterward. The guide also explains the example’s limitations.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Adds a Trigger.dev example that writes a synthetic value to browser local storage and verifies it in a later run. The task validates its operation and checkpoint ID, requires a secure CDP URL, and delegates browser work to Playwright. The example includes setup, execution, retry, and cleanup documentation.

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

Merge Risk: Minimal · up to 015e0 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Add an example that checks a remote Chrome checkpoint across runs" matches the main change. The PR adds a Cloudbrowser checkpoint example in which a Trigger.dev task writes a localStorage m…
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 "Add an example that checks a remote Chrome checkpoint across runs" matches the main change. The PR adds a Cloudbrowser checkpoint example in which a Trigger.dev task writes a localStorage marker in one run and verifies it in a later run over CDP. The title is specific and describes the primary change, so it passes.

Finishing Touches

Generate unit tests (beta)

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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: Advanced
  • Run ID: d9d2eae1-0c92-4ebc-b221-452eee16b5a7
Commits

Reviewing files that changed from the base of the PR and between 254ba91 and 015e06b.

Files ignored due to path filters: 1

  • cloudbrowser-checkpoint/package-lock.json is excluded by !**/package-lock.json
Files selected for processing: 8

  • README.md
  • cloudbrowser-checkpoint/.gitignore
  • cloudbrowser-checkpoint/README.md
  • cloudbrowser-checkpoint/package.json
  • cloudbrowser-checkpoint/src/browser-checkpoint.ts
  • cloudbrowser-checkpoint/src/trigger/checkpoint.ts
  • cloudbrowser-checkpoint/trigger.config.ts
  • cloudbrowser-checkpoint/tsconfig.json

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

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