Repository navigation
Show a PDF page or an image to the AI as a picture: File Search view_page (#1384) - #1402
Merged
Merged
Conversation
POST /render takes the same token, form and size limits as /extract and runs in the same isolated child process. PDF pages are rendered with pypdfium2, images with a fixed set of Pillow decoders after a pixel-count check; the JPEG is at most 2400 px and 1.5 MB. Errors are unsupported, page_out_of_range, encrypted, too_large, timeout or damaged. Refs #1379
<prefix>_view_page checks the path against the caller's scope, accepts PDF and image files only, and has files-worker read the file and the extractor render it; the JPEG leaves as MCP image content, which clients such as Claude.ai show while they do not show PDFs. Saving a connector's description now also creates built-in tools it is missing. Refs #1379
Existing File Search connectors only got their tools at activation, so view_page would never reach them. Once per boot, in the background, every activated FILE_SEARCH connector in every workspace gets the built-in tools it lacks, 50 connectors at a time; existing tools, File Share connectors and drafts are left alone, and errors are logged without stopping boot. Refs #1379
helpcodeai
force-pushed
the
feat/file-search-view-page
branch
from
November 1, 2026 18:41
fc40a8a to
9cb9654
Compare
helpcodeai
enabled auto-merge (squash)
November 1, 2026 18:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Found in the production test from Claude.ai: the AI can read the text of a PDF, but not what is drawn. A technical drawing's title block, a stamp or a scanned table has no text layer, and Claude.ai does not display embedded PDFs. The new read-only tool
<prefix>_view_pagereturns one page as a JPEG image block, which every MCP client shows to the model.ee/ authorization: the owner explicitly authorized changes under
deploy/ee/file-extractor/andpackages/backend/src/ee/file-search/for File Search; nothing else underee/is touched.Changes
POST /render: same token, upload limits and slots as/extract, run in the same isolated child process (timeout and memory limit).unsupported,page_out_of_range,encrypted,too_large,timeout,damaged.POST /internal/render: reads the file through the same index lookup and source read as/internal/fetch, within the plan's file size.file_view: checks scope and folder rules, PDF or image only. Returns an image block plus{path, page, pageCount, note}("use page N+1 for the next page").<prefix>_view_page(path,page), read-only and idempotent. Mentioned in_guide, the description drafts, the 11 File Search catalog entries and the docs._view_page).share_fileis created switched off.Cloud and self-hosted alike. Image size +32 KB, no new dependency (Pillow was already in the image).
Type
Testing
deploy/ee/file-extractor./test.shpackages/backendnpx tsc --noEmit -p tsconfig.jsonpackages/backendnpx jest src/file-search src/ee/file-search src/adapters/catalog src/mcp-server --maxWorkers=4node scripts/adapter-count.mjs --check,node scripts/generate-llms-txt.mjs --checkNew specs:
tests/test_render.py(35 tests: bombs, disguised EPS, out-of-range page, encrypted, damaged, size cap, auth, cleanup)file-search.engine.spec.ts(scope, unsupported type, plan size, success shape)file-search-backfill.service.spec.ts(6 tests)Related Issues
Relates to #1384, #1381, #1379.