Repository navigation
Studio: decode escaped spreadsheet text during RAG indexing - #16712
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Thanks @DimitriChrysafis. This is the backend counterpart of #16592: the knowledge base reader ( I checked that the two decoders agree on 20,000 random inputs, and an XlsxWriter round trip that main got wrong on 6 of 13 strings now comes back exact. Mirror CI is clear at |
What was broken
Spreadsheet previews decode Excel's
_xHHHH_text escapes after #16592, but RAG ingestion uses a separate reader and still indexes the encoded strings. Stored text differs from the preview, and lexical searches can miss the decoded cell contents.This is the backend follow-up noted in the merge comment on #16592.
Repro
91be10960, putZebra_x006D_arkerin an XLSX shared string, inline string or cached formula result.zebramarker. There are no lexical matches.Fix
Decode each text run before joining it, preserving quoted underscores and literal uppercase
_Xsequences. Combine UTF-16 surrogate pairs after joining runs, and replace unmatched surrogate units so the result remains valid UTF-8 for indexing. Cached formula strings use the same decoder. Number and error cells are unchanged.Test
Nineteen regression cases fail before the fix; all 21 selected cases pass afterward. Coverage includes shared, inline and cached strings, rich-run boundaries, phonetic hints, quoted escapes, supplementary Unicode, and Strict OOXML. Upload-to-FTS tests cover
.xlsx,.xlsm,.xltxand.xltm, using stub embeddings with the real ingestion and SQLite paths.From
studio/backend:The skip is the opt-in real-embedder test. Separately checked 16 exact string round trips through XlsxWriter-generated shared-string and inline-string workbooks, including control characters and escape-looking literals.
All seven repository checks and the pinned pre-commit formatter pass. No schema or dependency changes.