[PR #5490] Desktop file encoding issue #11430

Closed
opened 2026-02-16 18:16:16 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5490

State: closed
Merged: Yes


Issue with the display of some file types in the desktop app.

The shouldEncode() function treated all files with MIME type application/octet-stream as binary. Bun's MIME detection returns this type for many text-based programming languages, causing them to be unnecessarily encoded.

Added extension-based fallback checking before encoding application/octet-stream files. The function now checks if the file extension indicates a text file (.py, .go, .rb, .swift, .kt, etc.) and skips base64 encoding for these files.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5490 **State:** closed **Merged:** Yes --- Issue with the display of some file types in the desktop app. The shouldEncode() function treated all files with MIME type application/octet-stream as binary. Bun's MIME detection returns this type for many text-based programming languages, causing them to be unnecessarily encoded. Added extension-based fallback checking before encoding application/octet-stream files. The function now checks if the file extension indicates a text file (.py, .go, .rb, .swift, .kt, etc.) and skips base64 encoding for these files.
yindo added the pull-request label 2026-02-16 18:16:16 -05:00
yindo closed this issue 2026-02-16 18:16:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11430