HeadlinesBriefing favicon HeadlinesBriefing.com

Libretto PR Agents Fix Playwright Scripts

Hacker News •
×

Libretto PR agents is a new free TypeScript library designed to automatically fix failing Playwright browser automations. By adding a single line of code to existing Playwright scripts, the library enables an agent to automatically open GitHub pull requests (PRs) with proposed fixes when a script fails. This addresses the challenge of maintaining browser automation scripts as websites frequently change.

The Libretto PR Agent connects to the failed browser session via CDP, inspects the failure, and uses an exec tool to inject Playwright and JavaScript. It then opens a PR to the repository with a suggested code correction. The agent is open source, allows users to bring their own LLM provider API keys, and supports any browser provider.

This approach aims to simplify the maintenance of browser integrations, particularly for teams already using Playwright scripts in production who want AI-assisted debugging and repair without a complete migration. The tool is compatible with Playwright Page objects and works with various browser environments, provided the automation keeps the page open during failure debugging.