Skip to content

Transparent proxy: session-not-found 404 does not echo the request JSON-RPC id #5945

Description

@jhrozek

Summary

The transparent proxy's unknown-session guard returns a JSON-RPC -32001 (session not found) 404 whose body does not echo the incoming request's JSON-RPC id. session.NotFoundResponse builds the body via NotFoundBody(nil) (id hardcoded to null), whereas the classification-error path (mcp.ClassificationErrorResponse) does echo the request id. This is a minor consistency/asymmetry nit: a client correlating responses by id gets null for this one error class.

Where

  • pkg/transport/sessionNotFoundResponse / NotFoundBody(nil)
  • Emitted from the transparent proxy's unknown-session guard in pkg/transport/proxy/transparent/transparent_proxy.go (RoundTrip).

Suggested fix

Thread the parsed request id through to NotFoundBody (as the classification path already does) so the 404 echoes the id.

Context

Found while writing dual-era stateless proxy e2e tests (#5837). The 404 behavior itself is correct-by-design (deliberate fail-safe: the session guard keys on Mcp-Session-Id presence, not the client-forgeable revision) — this issue is only about echoing the id for symmetry. Low priority.

Activity

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

Metadata

Metadata

Assignees

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