// PLAYWRIGHT PR AGENTS --

Automatically fix failing Playwright scripts

Keep the browser automations you already run. When one fails, Libretto investigates the live page and opens a GitHub pull request with a proposed code fix.

OpenLibretto autofix for Playwright failure
libretto-agent wants to merge 1 commit into main
workflows/book-appointment.ts
- await page.locator('input[name="username"]').fill(login);
+ await page.locator('input[name="login"]').fill(login);

The sign-in field is name="login", confirmed by inspecting the live page.

// ONE FAILURE CALL --

Keep your scripts. Add the repair loop.

Your existing Playwright script runs normally. The PR agent starts only after a failure, when it can investigate what changed and propose a fix.

01

Keep your existing Playwright scripts

Add Libretto at the failure boundary without changing your fixtures, retries, logging, or deployment.

02

Use any browser provider

Run locally, in your own infrastructure, or with a hosted browser provider. The agent uses the live page you already created.

03

Bring your own model keys

Choose your LLM provider and keep its API key in your own environment.

04

Free to use

Libretto does not charge for the PR agent. Your model and browser providers may still charge for their usage.

// FAQ --

Frequently asked questions

What happens to the workflow after a failure?

The PR agent focuses on diagnosing the failure and proposing a code fix for future runs. Your existing catch, retry, fallback, and error handling remain responsible for the current run, while the agent opens a pull request when it finds a fix.

Do I need to use the Libretto runtime?

No. Add libretto-playwright-debug to an existing Playwright project, initialize the debugger once, and call debugFailure() from the failure path. Your current runtime, browser provider, deployment, and workflow structure stay in place.

Does it work with Selenium or Puppeteer?

Not yet. The current package accepts a Playwright Page, so the failed automation must run through Playwright. Selenium and Puppeteer would require separate adapters.

Does it work with any browser or cloud browser provider?

Yes. The PR agent works with local, self-hosted, and hosted browsers as long as your automation has a live Playwright Page and keeps it open while debugFailure() runs. You do not need to use Libretto Cloud for the browser session.

Is the PR agent free?

Libretto does not charge for the PR agent. You bring your own model provider API key and browser infrastructure, so your model or browser provider may still charge for their usage.

Is it open source?

Yes. The Playwright debugger package is open source under the MIT license in the Libretto repository.