fix(gateway-doc-toolchain): add lmodern + pandoc PDF build-time self-test#3
Merged
lilyshen0722 merged 1 commit intorebase-2026.3.29from May 6, 2026
Merged
Conversation
…test OPENCLAW_INSTALL_DOC_TOOLCHAIN already pulled pandoc + texlive-xetex + texlive-fonts-recommended, but pandoc PDF generation via xelatex needs lmodern.sty (the Latin Modern font set) which lives in a separate Debian package. Without it, every `pandoc input.md -o out.pdf --pdf-engine=xelatex` call fails with 'File lmodern.sty not found' — agents trying to produce PDF deliverables hit a runtime error. Two changes: 1. Add `lmodern` to the apt install list. ~2 MB extra in the toolchain layer; no new build-args. 2. Extend the build-time self-test to actually produce a one-page PDF from markdown and assert it's non-empty. A future regression that removes a required LaTeX package fails the docker build instead of surfacing at agent runtime as a missing-file error. Verified the failure mode on dev: agent producing a brief via pandoc errored with 'File lmodern.sty not found' on image clawdbot-gateway:0db858ec (no lmodern). DOCX/XLSX/PPTX via officecli are unaffected — they don't go through TeX. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lilyshen0722
added a commit
to Team-Commonly/commonly
that referenced
this pull request
May 6, 2026
Picks up Team-Commonly/openclaw#3 which adds lmodern to the doc-toolchain apt install. Without it, agents producing PDFs via pandoc + xelatex hit 'File lmodern.sty not found' at runtime. After Deploy Dev, Theo (and other dev agents with the pandic-office skill) can produce real Markdown→PDF deliverables via: pandoc input.md -o output.pdf --pdf-engine=xelatex Companion: openclaw#3, ADR-013 (#287). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Adds
lmodernapt package to the doc-toolchain build layer. Without it, pandoc's xelatex PDF engine fails with:Verified on the live commonly-dev cluster (gateway image
0db858ec) — everypandoc input.md -o out.pdf --pdf-engine=xelatexcall agents make hits this error. lmodern lives in its own Debian package, separate from texlive-xetex / texlive-fonts-recommended.Changes
pandoc texlive-xetex texlive-fonts-recommended \ + lmodern \ poppler-utils python3 python3-pipPlus extends the build-time self-test (only runs when
OPENCLAW_INSTALL_DOC_TOOLCHAIN=1is set, same as before) to actually produce a 1-page PDF and assert it's non-empty:A future regression that removes a required LaTeX package fails the docker build instead of surfacing at agent runtime as a missing-file error.
Why this matters
ADR-013 (Team-Commonly/commonly#287) ships dev agents with
pandic-officeskill that uses pandoc for Markdown → PDF. With this fix, agents can produce stakeholder-ready PDF briefs/reports/digests end-to-end. DOCX/XLSX/PPTX via officecli already worked (no TeX dependency).Size impact
Adds ~2 MB to the toolchain layer (the lmodern font set itself).
Test plan
OPENCLAW_INSTALL_DOC_TOOLCHAIN=1pandoc /tmp/test.md -o /tmp/test.pdfproduces a non-empty PDFpandic-officeskill🤖 Generated with Claude Code