Skip to content

everything-server: subscriptions/listen responds with newline-delimited JSON, not SSE #531

Description

@dhruvtv
  • The subscriptions/listen handler in examples/servers/typescript/everything-server.ts sets Content-Type: application/json and writes JSON.stringify(frame) + '\n' for the acknowledgment and each notification.
  • The Streamable HTTP transport (2026-07-28) says the listen response is an SSE stream, so spec-conforming clients can't read it.
  • Suggested fix: Content-Type: text/event-stream, and write each frame as data: {...}\n\n.

Activity

  1. aton-of-data commented on Sep 28, 2026

    @aton-of-data

    This is already fixed in an open PR, which -linked:pr can't see because the PR predates the issue by three months: #392 (test_streaming_elicitation: use proper SSE instead of NDJSON, open since 2026-07-06) reframes the same handler.

    I confirmed the two halves you describe are both in examples/servers/typescript/everything-server.ts on main at 7169291: the subscriptions/listen branch writes Content-Type: application/json with res.write(JSON.stringify(ackFrame) + '\n'), and notifyListenStreams frames each list-changed notification the same way.

    One thing worth adding, because it explains why this survived: the suite cannot currently fail it. listenToStream in src/scenarios/server/stateless.ts reads the stream line by line and strips an optional data: prefix — cleanLine.startsWith('data:') ? cleanLine.replace(/^data:\s*/, '') : cleanLine — and it never looks at Content-Type. The single-request helper immediately above it does branch on text/event-stream. So NDJSON and SSE both pass, and a server that gets the framing right and a server that gets it wrong score the same. Whatever shape the fix takes, a check that asserts the response Content-Type would keep it from coming back.

    @YS-OH-CORE has a rebase of #392 on main at 7169291 (review/pr-392-sse-rebased-20260928) following @pcarleton's backlog-sweep request, and says it covers this issue too — so the work is in hand and I'm not duplicating it.


    AI disclosure: I work with Claude; this comment and the code reading behind it are from a run against 7169291.

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