Skip to content

📊 fix: Read Run Code Spreadsheets Natively at Upload Instead of Through RAG - #103

Merged
TomasPalsson merged 2 commits into
aproorg/0.8.8from
fix/spreadsheet-upload-skip-rag-0.8.8
Nov 3, 2026
Merged

TomasPalsson merged 2 commits into
aproorg/0.8.8from
fix/spreadsheet-upload-skip-rag-0.8.8

Conversation

@TomasPalsson

Copy link
Copy Markdown

Summary

Under llmDeliveryPolicy: automatic, a spreadsheet (xlsx, csv, …) attached to a chat that can run code still had its text extracted at upload through the RAG API /text endpoint, even though Run Code reads the original file. On Sjúkra a large pivot workbook made /text run past its 5-minute timeout, the upload waited the full 5 minutes, and the jammed RAG API blocked every other upload and File Search request (2026-11-03 08:34–09:56).

When automatic reading would send the spreadsheet to Run Code and the chat can run code (saved agent with execute_code after capability and role checks, or for an ephemeral agent the capability plus the Run Code grant), the upload now reads the text with the built-in readers (SheetJS for workbooks, native text for CSV/TSV/JSON) and stores the file as llmDeliveryPath: 'none' with that text. RAG is not called. A later turn without Run Code re-resolves the record to 'text' and delivers the stored text, so the file never reaches nothing. If the built-in reader cannot read the file (over 15 MB, unreadable, text over the storage cap), the upload takes today's path unchanged.

Also: when RAG /text fails on a CSV/TSV/JSON upload, the fallback now reads native text instead of handing it to the document parser, which rejected CSV (Unsupported file type in document parser: text/csv).

Unchanged: classic endpoints, legacyFileUploadUX, chosen destinations, agent resource uploads, an active file policy, per-type defaultLLMDeliveryPath overrides.

Type of change

  • Bug fix

Testing

  • api/ Files services and routes, BaseClient, agents client: 1085 passed.
  • packages/api files, agents/files, initialize, attachments, client, storage: 1810 passed (emf.helper.ts has no tests; libreoffice.spec.ts needs LibreOffice on PATH).
  • packages/data-provider resolver and file-config specs: 385 passed.
  • tsc --noEmit and eslint clean.
  • Reviewers mutated every rule in the plan's table; each mutation fails a test.
  • SheetJS read + sheet_to_csv on 1 CPU: 10 MB / 9.9M-char workbook 1.55 s, 15 MB 2.66 s (the live Sjúkra workbook extracts about 9.45M characters).

Risk / compatibility

  • The built-in workbook reader runs on the request thread; worst case a few seconds for a 15 MB workbook. It already runs there today after a RAG failure.
  • The file preview's extracted-text panel shows only for 'text' records, so these spreadsheets no longer show it.

…gh RAG

Under automatic reading, a spreadsheet attachment that Run Code will read is
parsed with the built-in readers at upload and stored as `none` with its text,
skipping the RAG /text call. A file the readers cannot parse keeps the RAG path.
After a RAG failure, natively readable text (CSV/TSV/JSON) is read natively.
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d4a0462a-db92-4140-8d38-89842855239c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@TomasPalsson
TomasPalsson merged commit 29839c6 into aproorg/0.8.8 Nov 3, 2026
24 of 27 checks passed
@TomasPalsson
TomasPalsson deleted the fix/spreadsheet-upload-skip-rag-0.8.8 branch November 3, 2026 10:55
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