Skip to content

fix: decode streams when responses omit content type#46

Open
jeet-dekivadia wants to merge 1 commit into
anthropics:mainfrom
jeet-dekivadia:codex/fallback-to-request-accept-for-decoding
Open

fix: decode streams when responses omit content type#46
jeet-dekivadia wants to merge 1 commit into
anthropics:mainfrom
jeet-dekivadia:codex/fallback-to-request-accept-for-decoding

Conversation

@jeet-dekivadia
Copy link
Copy Markdown

@jeet-dekivadia jeet-dekivadia commented May 30, 2026

Summary

  • fall back to the originating request Accept header when a response omits Content-Type
  • pass the request into response decoding
  • add a JSONL regression for the missing-header path

Why

Batch result streams request application/x-jsonl, but the API response can omit Content-Type. In that case the SDK currently returns raw body chunks instead of decoded response objects. Keeping the response header authoritative when present and using the request header only as a fallback restores the expected stream shape.

Validation

  • git diff --check
  • added focused coverage for JSONL decoding when the response omits Content-Type

Fixes #30

Remote Linux validation

  • git diff --check
  • ./scripts/bootstrap
  • ./scripts/lint
  • ./scripts/test

@jeet-dekivadia jeet-dekivadia requested a review from a team as a code owner May 30, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Batch results are not converted to individual response objects

1 participant