Skip to content

docs: CDP serve production guide + AI agent integration patterns#1954

Open
Nicolas0315 wants to merge 1 commit intolightpanda-io:mainfrom
Nicolas0315:docs/cdp-serve-guide
Open

docs: CDP serve production guide + AI agent integration patterns#1954
Nicolas0315 wants to merge 1 commit intolightpanda-io:mainfrom
Nicolas0315:docs/cdp-serve-guide

Conversation

@Nicolas0315
Copy link

Summary

Adds two new documentation files in docs/ covering production deployment and AI agent integration — the two areas where we found the most friction as early adopters.

docs/cdp-serve-guide.md — CDP Serve Production Guide

Covers the "Getting Started → Production" gap that currently exists in the README:

  • --timeout gotcha: The default --timeout 10 silently disconnects CDP clients that pause for >10 seconds (common in AI agent workflows where the agent waits for LLM responses between page interactions). Documents the fix (--timeout 0) prominently.
  • --cdp_max_connections tuning: Memory estimates per connection count (e.g., 128 connections ≈ 900 MB).
  • HTTP tuning table: --http_max_concurrent, --http_max_host_open, --http_timeout with recommended values for crawl workloads.
  • Health check examples: curl script, Docker HEALTHCHECK, and docker-compose.yml with health checks.
  • Process management: systemd unit file and macOS launchd plist.
  • Troubleshooting table: Links to known issues ([BUG] CDP WebSocketDebuggerUrl returns 0.0.0.0 causing remote CDP clients to fail (ECONNREFUSED) #1922, etc.) with workarounds.

docs/ai-agent-integration.md — AI Agent Integration Patterns

5 connection patterns with complete, tested code examples:

  1. Direct Puppeteer — single agent, sequential browsing
  2. Parallel Page Pool — concurrent crawling with memory estimates (20 pages ≈ 140 MB vs Chrome's 5.6 GB)
  3. Lightpanda → Chrome Fallback — automatic fallback with detection thresholds (DOM element count, body text length, JS error count, noscript detection)
  4. Playwright (Python) — with connect_over_cdp
  5. chromedp (Go)RemoteAllocator

Also includes:

Context

We're building next-browse, a knowledge-first browser that uses Lightpanda as the default CDP engine for autonomous agent crawling with Chrome as a fallback for complex SPAs. These docs are distilled from our real integration experience.

Checklist

  • No code changes — documentation only
  • All code examples tested on macOS aarch64 nightly build
  • References existing open issues where relevant

- CDP serve guide: timeout gotchas, health checks, Docker/systemd/launchd config,
  troubleshooting table with links to known issues (lightpanda-io#1922)
- AI agent integration: 5 connection patterns (Puppeteer, parallel pool,
  Lightpanda→Chrome fallback, Playwright Python, chromedp Go), performance
  benchmarks from macOS aarch64 real-device testing, recommended configs
  for different workloads, known limitations table
@github-actions
Copy link

github-actions bot commented Mar 22, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Nicolas0315
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant