Why Weavetab Uses an In-Process CDP — Weavetab Blog
Published: 2026-06-19 · Engineering
An engineering note on why the tool router and the CDP client share a process, and why we did not build on WebDriver, Playwright, or Puppeteer as a...
## The design constraint
An agent-driven browser session is bounded by the model's turn latency, not by the browser. That leaves a small budget for the tool layer itself, and a strict requirement that the tool layer not add avoidable structure that inflates the context.
## Where the time goes
A tool call has a fixed set of costs:
- routing the call to the right primitive,
- validating arguments against a schema,
- serializing a CDP message,
- writing it to the browser over the WebSocket,
- waiting for the browser to acknowledge and act.
The last step - the browser itself - dominates. The goal is not to eliminate it; it is to not add anything on top of it.
## What we rejected
WebDriver introduces an HTTP hop and a JSON-over-HTTP session model, which is a poor fit for a hot path. Playwright and Puppeteer are excellent libraries, but their process-boundary architecture is designed for authored test suites rather than high-frequency agent traffic. Building on either would mean paying for a boundary we do not need.
## What we kept
- a single persistent CDP WebSocket per session,
- a tool router and CDP client that share one event loop, with no channel between them,
- a compact internal payload format for tool results.
This is a design rationale, not a benchmark report. For measured comparisons, see the separately published benchmark run.