Libretto adds AI agents that auto-fix broken Playwright scripts via PRs

Libretto adds AI agents that auto-fix broken Playwright scripts via PRs

Libretto PR Agents is a free TypeScript library that maintains Playwright scripts. Adding a single line of code to an existing Playwright script lets an agent automatically open a GitHub pull request that fixes the script whenever it fails. Libretto originally launched a few months earlier as a CLI plus a for building deterministic .

The reasoning was that for many repetitive business browser workflows, an AI agent doesn't need to make runtime decisions each time — deterministic Playwright scripts are easier to inspect, run faster, and cost much less than repeatedly calling an AI browser agent. The catch is that websites change over time, which breaks these deterministic scripts, making maintenance across many scripts a real headache. For teams that already have a large set of working Playwright scripts, rewriting everything around a newer AI runtime framework like browser-use or stagehand just to ease maintenance is undesirable.

The Libretto PR Agent pulls the relevant code from GitHub and connects via CDP () to the exact that just failed, using an exec tool to inject Playwright commands for diagnosing and fixing the break.

Key points

  • Free TypeScript library added with one line of code to existing Playwright scripts
  • When a script fails, an agent diagnoses the cause and opens a GitHub PR with a fix
  • Built on the earlier philosophy of deterministic scripts over runtime AI decisions for speed and cost savings
  • Uses CDP to connect to the exact failed for debugging
  • Avoids the need to migrate to newer AI runtime frameworks like browser-use or stagehand
Read original