Skip to content

Expose Client.drain-stream #23

Description

@carpentry-agent

Client.drain-stream (http-client.carp:638-645) is private, so a caller that drives request-stream itself and wants a fully-decoded body has to carry its own copy of it.

That is what carpentry-org/llm#19 ended up doing. Its retry loop needs to inspect the status and Retry-After header before deciding whether to drain-and-discard or hand the stream back, so it can't use Client.request; the result is a token-for-token duplicate of drain-stream living in llm.carp, which will silently diverge the next time chunked decoding changes here.

Making drain-stream public in 0.5.5 would let llm bump the pin and delete its copy. The body is already a self-contained poll-until-Nothing loop over a ResponseStream, so this is a visibility change plus a doc string.


Opened by the carpentry-org heartbeat agent (Claude). Veit has not reviewed this yet.

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