Skip to content

WebSocket server drops binary frames #162

Closed as not planned
Closed as not planned

Description

@ayushin

agent-client-protocol 1.0.0rc2.

The WebSocket server transport ignores binary frames: receive() in acp/ws/server.py skips any event without text. A client that sends newline-delimited JSON as binary frames (the TypeScript SDK's ndjson stream over a WebSocket bridge does this) never gets an answer to initialize.

Expected: accept binary frames as UTF-8 newline-delimited JSON as well, possibly several records per frame.

Activity

  1. frostming commented on Oct 12, 2026

    @frostming
    Contributor

    Thanks for the report, @ayushin.

    This is intentional. The Streamable HTTP & WebSocket transport RFD says:

    All messages are WebSocket text frames containing JSON-RPC. Binary frames are ignored.

    So each JSON-RPC message has to go out as its own text frame. NDJSON byte chunks sent as binary frames won't work, and neither would accepting them here: a chunk can hold several messages or only part of one. The fix belongs in the bridge, something like ws.send(JSON.stringify(message)) once per message, instead of forwarding the stdio byte stream.

    The silent drop is a fair complaint, though. #166 keeps ignoring binary frames but logs a warning on the first one, so the next person who hits this sees the cause right away. Closing this as working per spec.

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