Skip to content

feat(http): stream locally handled requests and responses #854

Description

@leseb

Description

Implement the accepted local-handler contract in the Pingora HTTP path.
Select body capabilities after route claim, give the handler an exclusive
backpressured request stream, and stream its response through compatible
response policies.

Cover cancellation signaling, downstream disconnects, Expect: 100-continue,
oversized-body connection closure, access logging, metrics, and cleanup.

Acceptance Criteria

  • No upstream connection or request forwarding occurs after a local claim.
  • No reachable request StreamBuffer consumer can pre-read a claimed upload.
  • Local response headers pass through CORS/security-header filters before being
    written.
  • Compatible streaming response filters receive local response chunks;
    full-response buffering is rejected for unbounded local content routes.
  • Route-scoped counters support large streams without raising Praxis's global
    buffering ceiling.
  • Disconnect/cancellation is observable by the handler without promising
    async cleanup from Drop.
  • Protocol tests cover backpressure, early rejection, 100-continue, partial
    response failure, keepalive/connection closure, and exactly-once logging.

Motivation

The Files API needs end-to-end streaming, but this core primitive should serve
any future Praxis-owned HTTP API without embedding OpenAI-specific behavior.

Alternatives Considered

  • A Files-specific Pingora bypass: rejected because it would duplicate policy,
    logging, and cancellation behavior outside the filter pipeline.

Area

Protocol

Parent Epic

praxis-proxy/ai#494

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Next
    Status
    Next

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions