Skip to content

feat(agents-box): bake PyMuPDF, Pillow and numpy into /opt/doctools - #232

Closed
joedanz wants to merge 1 commit into
mainfrom
feat/doctools-pdf-render
Closed

joedanz wants to merge 1 commit into
mainfrom
feat/doctools-pdf-render

Conversation

@joedanz

@joedanz joedanz commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Why

Agent-ayal now runs behind an egress allowlist, and PyPI is not on it. Until 2026-09-22 the agent installed PDF/image tools at runtime with uv run --with pymupdf … (about 60 runs). Since 09-23 it has used only baked tools (pdftotext, doc2text, pypdf, openpyxl) and made no installs, so nothing is broken today. This puts the remaining library in the image so a runtime install is never needed.

What

  • /opt/doctools gains pymupdf==1.28.2, pillow==13.0.0, numpy==2.5.4 (venv 18 MB → about 136 MB).
  • The same RUN imports every library, so a bad pin fails the image build.
  • OCR stays tesseract through doc2text. RapidOCR is left out on purpose: +285 MB, not used since 2026-09-09.
  • Pins are what uv resolves under its 14-day exclude-newer cutoff; checked 2026-10-20 in a scratch Python 3.13.5 venv: PyMuPDF rendered a page and RapidOCR (test only) read it back.

Tests

tests/test_agents_box_doctools.py (3) + existing doc2text/boot/safety-net suites: 89 passed, 1 skipped. Not tested: an actual docker build (no Docker in this session).

Deploy (needs a decision)

Shipping means rebuilding hermes-brain and recreating the agents on each box, which restarts every agent there. Not done.

https://claude.ai/code/session_01DAcnnbhk6e7PpBhgJjTewZ

Agents now run on a network allowlist that does not include PyPI, so tools an
agent used to fetch at runtime (uv run --with pymupdf, ~60 runs 08-28..09-22)
must be in the image. Pinned to what uv resolves under its 14-day cutoff and
verified with a render + import test on Python 3.13.5. The build imports every
library, so a bad pin fails the build. OCR stays tesseract; RapidOCR left out
(+285 MB, unused since 09-09).

Claude-Session: https://claude.ai/code/session_01DAcnnbhk6e7PpBhgJjTewZ
@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
brainkit-docs Ready Ready Preview Oct 20, 2026 5:03pm UTC

Request Review

@joedanz

joedanz commented Oct 20, 2026

Copy link
Copy Markdown
Owner Author

Closing without merging. This PR baked PyMuPDF, Pillow and numpy into the agent image because the agent's network allowlist blocked PyPI. The allowlist was dropped on 2026-10-20 (Parker now has open web access), so the agent can install packages itself again and the image change is not needed. Since 2026-09-23 the agent has used only the tools already in the image (pdftotext, doc2text, pypdf, openpyxl). The branch feat/doctools-pdf-render is left in place in case we want it later.

@joedanz joedanz closed this Oct 20, 2026

This branch was successfully deployed

1 active deployment
Preview — 7e73d842 Deployed Oct 20, 2026 by vercel[bot]
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