From c879c0274bda1bf4a35585c9ccbb3ecfeb4efde6 Mon Sep 17 00:00:00 2001 From: masnwilliams <43387599+masnwilliams@users.noreply.github.com> Date: Fri, 22 May 2026 16:56:23 +0000 Subject: [PATCH] Expand control.mdx with computer use + playwright execution patterns Adds three named patterns (tool, checkpoint, drop-the-agent) as short bullets under the existing recommended-pattern section. No new page. Co-Authored-By: Claude Opus 4.7 --- introduction/control.mdx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/introduction/control.mdx b/introduction/control.mdx index 820efc9..418c4e8 100644 --- a/introduction/control.mdx +++ b/introduction/control.mdx @@ -163,6 +163,11 @@ If you're reaching for Playwright, prefer the execution API over `connectOverCDP Computer controls drive the browser the way a person would — they don't speak the programmatic API surface. Anything you'd reach for the DOM or Playwright client for (reading text and attributes, `page.goto`, file uploads, cookie or storage access, switching tabs) belongs on the [playwright execution](/browsers/playwright-execution) side. The recommended pattern for agents is computer controls for interaction, playwright execution as a tool the agent can call when it needs structured data or a programmatic action. +A couple of patterns this enables: + +- **Checkpoint between steps.** After a step you can't verify from a screenshot — a login, a cart add, a multi-step form — use playwright execution to assert cookies or DOM state before letting the agent continue. Cheaper than another screenshot round-trip and harder to hallucinate around. +- **Drop the agent once selectors are stable.** The agent's job was finding the right things to click and extract. Once you have stable selectors, the next million requests don't need a model — hit URLs directly via playwright execution. + ```typescript Typescript/Javascript const response = await kernel.browsers.playwright.execute(