Skip to content

Preserve zero-byte binary files in embed-multi - #1926

Draft
tgolob wants to merge 1 commit into
simonw:mainfrom
tgolob:fix/embed-multi-empty-binary
Draft

tgolob wants to merge 1 commit into
simonw:mainfrom
tgolob:fix/embed-multi-empty-binary

Conversation

@tgolob

@tgolob tgolob commented Nov 23, 2026

Copy link
Copy Markdown

embed-multi --files ... --binary reads a zero-byte file as b"". The shared fallback introduced in #746 converts it to empty text before embedding. That makes a binary-only model reject the file and lets a dual-mode model store it as TEXT. Pass the resolved value through so the model receives b"". With --store, a model that accepts empty bytes stores a zero-length BLOB in content_blob, consistent with #254.

The regression test invokes the CLI with a binary-only model and checks the stored bytes. It failed on 0.38 and passed with this change. A separate CLI probe confirmed the SQLite type before and after and checked nonempty binary and empty text inputs. An existing row indexed as text can still be skipped on same-ID reimport because the content hash is the same.

OpenAI Codex authored and reviewed the patch and ran the verification described above.

This branch has not been deployed

No deployments
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.

2 participants