#116

perf: upgrade agent-browser and stream d3k telemetry

Opencarlchunguswants to merge intofrom

Summary

  • Upgrade d3k's bundled agent-browser from 0.34.0 to 0.36.0.
  • Replace the 500 ms Runtime.evaluate telemetry loops with CDP Runtime.addBinding/Runtime.bindingCalled, retaining polling only as a compatibility fallback.
  • Remove the extra agent-browser connect process d3k spawned before every browser command by passing the active CDP endpoint directly.
  • Declare Ink's optional react-devtools-core peer so native binary builds are reproducible.

Why

This keeps the high-fidelity path inside the runtime: interaction, React, and layout-shift telemetry arrive as CDP events instead of repeatedly evaluating page JavaScript, and browser commands use one native agent-browser process per operation. The fork still retains a polling fallback for older pages/CDP targets.

Verification

  • bun run lint ✅
  • bun run typecheck ✅
  • bun run build ✅
  • D3K_BUILD_TARGETS=darwin-arm64 bun run build:binaries ✅
  • Focused tests: 76 passed, 0 failed before the build-peer fix; full suite has the existing temp-home/session failures only.

Activity

8
vercel[bot]2mo ago

@carlchungus is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

socket-security[bot]2mo ago

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
npm/​agent-browser@​0.34.0 ⏵ 0.36.0 +1 +1 +2
npm/​react-devtools-core@​7.0.1

View full report

carlchungus2mo ago

Follow-up optimization in 924e0e9:

  • d3k interaction/React telemetry now uses Runtime.addBinding/Runtime.bindingCalled instead of a permanent 500ms Runtime.evaluate poll.
  • d3k CLS/layout-shift telemetry uses the same event-driven binding instead of two 500ms evaluations while capturing.
  • Compatibility polling remains for CDP implementations that reject bindings.
  • Added payload validation and regression tests for event routing and the no-polling path.

This is intentionally separate from agent-browser's native engine work: the current upstream agent-browser already contains the native CDP/accessibility/geometry/stream optimizations, so the fork only carries the d3k-specific missing seam.

carlchungus2mo ago

Additional transport optimization in 59a4cd6:

  • d3k now passes the active session's --cdp endpoint directly to each agent-browser command instead of spawning a separate agent-browser connect process first.
  • Explicit --cdp, profile, connect, and close flows retain their existing semantics.
  • Added argv coverage for the direct-CDP path.

This removes one native process startup and one wrapper round-trip per d3k browser command.