Skip to content

feat: Support XLSB (Excel Binary Workbook) Sandbox Artifacts - #333

Open
gafda wants to merge 1 commit into
LibreChat-AI:mainfrom
nosportugal:feat-xlsb-support
Open

gafda wants to merge 1 commit into
LibreChat-AI:mainfrom
nosportugal:feat-xlsb-support

Conversation

@gafda

@gafda gafda commented Oct 12, 2026

Copy link
Copy Markdown

This pull request adds support for the XLSB (Excel Binary Workbook) file format across the build environment and protocol layer, ensuring that workflows producing .xlsb files (e.g., via the calamine engine in pandas) are properly handled and served with the correct Content-Type. The changes include updating package installation scripts, protocol extension/media type mappings, and tests.

Build environment updates:

  • Added python-calamine to the list of installed Python packages in both build-packages.sh and docker/package-init.sh to enable reading .xlsb files in Python workflows. [1] [2]

Protocol support for XLSB:

  • Added .xlsb to the supported bridge artifact extensions in protocol.ts.
  • Mapped .xlsb to the correct media type (application/vnd.ms-excel.sheet.binary.macroenabled.12) in the bridge artifact media types.

Testing:

  • Added tests to verify that .xlsb files are recognized as supported artifacts and served with the correct Content-Type.

Add .xlsb to the hardened egress gateway's artifact policy and the
sandboxed Python image's spreadsheet packages, so Code Interpreter
sessions can produce and read Excel Binary Workbook files end to end.

- protocol.ts: add .xlsb to BRIDGE_ARTIFACT_EXTENSIONS (the egress
  gateway's output allow-list) and map it to
  application/vnd.ms-excel.sheet.binary.macroenabled.12 in
  BRIDGE_ARTIFACT_MEDIA_TYPES, next to the existing .xls/.xlsx entries.
  Without the first change, a sandboxed script that writes a .xlsb
  output would have it rejected by the gateway with a generic
  'unsupported file type' error.
- build-packages.sh / docker/package-init.sh: add python-calamine next
  to the existing xlrd entry in both the Docker-image-bake and
  PVC/direct-NsJail install paths (hand-maintained parallel lists, not
  generated from one another). pandas cannot auto-detect the .xlsb
  engine the way it does for .xlsx/.xls, so sandboxed code reads these
  files via pd.read_excel(path, engine='calamine'). calamine was
  chosen over pyxlsb (the other common option) because it's a single,
  faster, Rust-backed engine that also already handles
  .xlsx/.xls/.ods, rather than adding a second, XLSB-only dependency.
- protocol.test.ts: extend the existing bridge-artifact-policy test
  with explicit .xlsb assertions covering both the extension allow-list
  and the media-type mapping.

No change needed on the librechat side's code-interpreter integration:
once librechat's own XLSB support lands, the existing text-extraction
path already calls into this same engine.
@gafda
gafda marked this pull request as ready for review October 13, 2026 08:15
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.

1 participant