You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Files with .odt extension are silently corrupted on download — binary file transcoded as UTF-8 text #1256
Any .odt file (OpenDocument Text) that an agent creates in Z.ai web chat arrives corrupted when the user downloads it: the file grows in size and is no longer a valid ZIP/ODF container. Byte-level forensics prove the download pipeline treated this binary file as UTF-8 text and replaced every invalid byte with U+FFFD (REPLACEMENT CHARACTER).
Other binary formats — .docx, .pdf, .zip — download byte-identical and are not affected.
The equality is exact (same md5), so the transport ran the binary through a UTF-8 text transcoding path.
77,573 bytes were invalid UTF-8 and were each replaced with U+FFFD (EF BF BD), inflating the file by ~82% and destroying the ZIP structure.
The same .odt packed inside a .zip attachment arrives byte-identical — the file itself is valid; only the loose-.odt download path is broken.
Probable root cause
The MIME type application/vnd.oasis.opendocument.text contains the substring text, so the transport likely classifies .odt as a text file and applies text processing. Consistent with this: .docx (application/vnd.openxmlformats-officedocument.wordprocessingml.document) and .pdf (application/pdf) do not contain text in their MIME type and pass through unchanged.
Suggested fix
Treat attachments as opaque binary by default. If a text-detection heuristic is needed, restrict it to text/* plus a whitelist of known text formats (.txt, .md, .csv, .json, …) — and explicitly exclude binary container types such as application/vnd.oasis.opendocument.*. Never apply errors='replace' transcoding to file downloads.
Workaround for users
Pack .odt (and any binary file) into a .zip wrapper — zip attachments survive the transfer untouched.
Impact
Silent data corruption: the file looks normal in the chat UI, but the downloaded copy is unusable. Users who don't verify checksums lose their documents without noticing.
Accidental duplicate: my automation retried the issue-creation API call, although the first call had already succeeded (this issue was created twice, moments apart). The original issue is #1255 — please continue the discussion there. Closing this one. Sorry for the noise.
Activity
github-actions commentedon Oct 27, 2026
👋 感谢你的反馈,我们已经收到。
status: 待评估,你可以随时补充信息。needs: 更多信息标签并 @ 你。👋 Thanks — we've received your issue.
status: 待评估(Triage); feel free to add context.needs: 更多信息and ping you.vadimrm commentedon Oct 27, 2026
Accidental duplicate: my automation retried the issue-creation API call, although the first call had already succeeded (this issue was created twice, moments apart). The original issue is #1255 — please continue the discussion there. Closing this one. Sorry for the noise.