Files
magpie/internal
ggbdpq fee33668db gateway: a PDF survives translation (#5452)
A PDF reached the model only when the request was relayed as sent; the
moment magpie translated it, the file was lost — the Responses
input_file and the Messages document were dropped whole, and the Chat
file became the placeholder text "[attachment application/pdf]"
(#5452, NemoAir: three paths located line by line; a ChatGPT API
account speaks only Responses and only streams, so a Chat request to it
always translated and its file always became the note, and a
non-streaming Responses request to a stream-only account lost its
input_file while the same request streamed arrived whole).

The parts parse into file parts now — the Responses input_file (a
standalone item, its file_data and filename flat on the item, and a
message block, flat as the OpenAI shape has it or nested as a Chat
client sends) and the Messages document — and the Responses and
Messages encoders write inline data in their own tongue (input_file /
document), where Gemini's inline data already rode. A file only
referenced — a Gemini fileUri on the vendor's storage, or another
host's file id — is still told of: Responses' file_id is OpenAI's own,
Anthropic's url source takes http(s) and not a cloud-storage scheme,
and the Chat encoder keeps telling of the file rather than carrying it,
Chat upstreams' file support being uneven and a 400 there losing the
whole turn (#934). The Claude subscription line renders text to its
CLI, which carries no PDF either way.

Rebased onto the video work (#6135), which reads an input_file of a
video alone and left this face standing: a video rides the video
machinery still, and every other file — a PDF, say — is a file part.

Generated-by: GLM-5.3-Flash (ZCode)

Landed from @ggbdpq's patch on #5452, reported by NemoAir. The commit
after it scopes the change to PDFs.
2026-11-14 19:46:12 +08:00
..
…
…
…
…
…
…
…
…
…
…
…