Skip to content

Bound memory use in the CLI browser bridge #847

Description

@pgherveou

The CLI browser bridge converts binary frames and WebSocket payloads into JSON number arrays across Playwright bindings. A 64 MiB binary payload can therefore occupy much more memory across the browser, JSON serialization and Bun copies. The WebSocket event queue also lacks a byte budget.

Raised in #829 (comment). Permission enforcement fixes stay in #829; transport resource budgeting needs a consistent policy across these paths.

  • Define byte limits for product protocol frames, WebSocket messages and queued events, accounting for simultaneous connections.
  • Reduce binary serialization amplification and reject oversized payloads before avoidable copies where possible.
  • Apply backpressure or close a stalled connection when its budget is exhausted.
  • Add focused boundary and slow-consumer checks, and document supported limits.

Codex-assisted.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions